Rabu, 02 Januari 2008

laporan linux transfer data ssh dan scp

SSH
SSH server merupakan suatu program aplikasi yang berfungsiuntuk melakukan remote server untuk suatu keperluan, antara lain untuk melakukan pemeliharaan system dan administrasi user maupun grup serta untuk melakukan pengamatan dan pengawasan mesin dari jauh.

Konfigurasi SSH Server
Pastikan paket openssh sudah terinstal pada saat installasi Linux :
user@himatif:~$ sudo dpkg –l | grep ssh
ii openssh-client 4.2pl-7ubuntu3 Secure shell client,
an rlogin/rsh/rcp repla
ii ssh-askpass-gnome. 4.2pl-7ubuntu3 under X,
asks user for a passphrase for ssh-

Lakukan editing pada file/etc/ssh/sshd_config, dengan cara ketikkan perintah berikut ini:
user@himatif:~$ sudo vi /etc/ssh/sshd_config

Perintah tersebut diatas akan menampilkan isi dari file /etc/ssh/sshd_config, seperti berikut ini :
user@himatif:~$ sudo vi /etc/ssh/sshd_config
# Package generated configuration file
# Seethe sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protokol 2
#HostKeys for protocol version 2
HostKeys /etc/ssh/ssh_host_rsa_key
HostKeys /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on of security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SysLogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Dont’s read the user’s ~/.rhostsand ~/.shostsfiles
IgnoreRhosts yes
# For this to work you will also need host key in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don’t trust ~/.ssh/known_hosts for
RhostsRSAAuthentication
#ignoreUserKnownHosts yes

# To enable empty passwords, change to yes(NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunneled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrlocalPasswd yes
#KerberosTickedCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
KeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes

Untuk menjalankan openssh server, ketikkan perintah berikut ini :
user@himatif:~$ sudo /etc/init.d/ssh start

Untuk menjalankan secara otomatis pada saat computer dinyalakan, ketikkan perintah berikut ini :
user@himatif:~$ cd /etc/init.d/
root@himatif:/etc/init.d# update-rc.d ~n ssh defaults


SCP
SCP merupakan perintah pengiriman file/data pada openssh secara terenskripsi, sehingga data/file yang terkirim lebih aman.

Langkah-langkahnya sebagai berikut :
Pada konsol, loginlah sebagai user user :
Login: user
Password:

Jika ingin mengirim file ke server, pada home direktori student ketikkan perintah berikut ini :
[student@himatif ~]$ scp –r file himatif@192.168.123.1:/home/

Maka akan muncul tampilan sebagai berikut :
himatif@192.168.123.1 ‘s password:

Jika password disetujui,file akan dikirim dengan terenskripsi
File 100# 40KB 1.3MB/s 00:00

Tidak ada komentar: