rsync tanpa password

10 Aug

diinginkan melakukan rsync dari komputer A [172.20.140.32] ke komputer B [172.20.140.33]

============================
komputer A [172.20.140.32]
============================
1. Generate SSH encryption key pair untuk filecopy account.
[root@linux samba]# ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ”
Generating public/private dsa key pair.
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
b8:cb:90:e4:9f:94:6f:bb:a5:13:60:ae:21:36:3f:de root@linux

2. Copy public key komputer tujuan. [komputer B]
[root@linux samba]# scp /root/.ssh/id_dsa.pub root@172.20.140.33:public-key.tmp
root@172.20.140.33’s password:
id_dsa.pub 100% 600 0.6KB/s 00:00

============================
komputer B [172.20.140.33]
============================
3. Login ke komputer tujuan dan Create .ssh subdirectory pada home directory
[root@linux ~]# mkdir .ssh
[root@linux ~]# chmod 700 .ssh
[root@linux ~]# cd .ssh

4. Tambahkan public-key.tmp ke akhir file authorized_keys
[root@linux .ssh]# cat ~/public-key.tmp >> authorized_keys
[root@linux .ssh]# chmod 700 /root/.ssh
[root@linux .ssh]# rm ~/public-key.tmp

============================
komputer A [172.20.140.32]
============================
5. Lakukan test
[root@linux samba]# rsync -avz /dt03/sketsa2 root@172.20.140.33:/u01

6. buat schedulle dengan crontab, agar dpt dijalankan secara periodik
[root@linux samba]# vi /folder/rsync_01
/usr/bin/rsync -avz /dt03/sketsa2 root@172.20.140.33:/u01
/usr/bin/rsync -avz /dt02/foto_full root@172.20.140.33:/u01

[root@linux samba]# chmod a+x /folder/rsync_01

[root@linux samba]# crontab -e
55 20 * * * /folder/rsync_01

4 Responses to “rsync tanpa password”

  1. giri December 4, 2010 at 2:44 am #

    kalau melakukan rsync otomatis anatara server dan client bisa atau tidak ya? saya dapat tugas untuk membackup dan mensinkronisasi data dengan rsync. Ketika si user terhubung ke serer maka rsync otomatis jalan, tanpa melakukan apap- apa lagi. mohon bantuannya. terima kasih.

    • setijoagus December 4, 2010 at 9:01 am #

      maksudnya 2 arah / bidirectional ?, ya bisa, asal yang anda sebut client juga ada di-install ssh server
      salam

      • giri December 11, 2010 at 3:12 pm #

        iya…
        tp saya disuruh untuk membuat sebuah script (bash scripting), di mana script tersebut dieksekusi langsung ketika si client terkoneksi ke server. Dalam pembuatan script ini dah saya masih bingung, karena baru pertama kali.

        Mohon bantuannya.
        salam

      • setijoagus December 13, 2010 at 2:14 am #

        he…he… ya langsung dibuat dong

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: