Autologin SSH – My Old One Posting

Our plans are login into server B as user hary, from server A as user hary too
1. Create user har both of server by using ~# useradd -d /home/hary hary
2. Then give theirs the passwords.
3. [serverA]~# ssh-keygen -t rsa
4. [serverA]~# ssh hary@<ipserverB> mkdir -p .ssh
5. [serverA]~# cat .ssh/id_rsa.pub | ssh hary@ipserverB ‘cat >> .ssh/authorized_keys’
6. [serverA]~# ssh hary@ipserverB “chmod 700 .ssh ; cmod 640 .ssh/authorized_keys”
7. [serverA]~# ssh hary@ipserverB

Lalu kita bisa menggabungkan fungsi tersebut dengan remote synchronized (rsync) . Pelajari capture code berikut :
rsync

Atau proses copying yang bisa melakukan proses continue dengan : rsync –partial –progress –rsh=ssh tsel20150[1-8]* <ip>@<ip_address>:/data/backup2016/logssmscapi/ ..Atau dengan cara yang lebih mudah, dengan memasang paket sshpass dan menggabungkannya dengan tools rsync untuk mendapatkan hasil yang luarbiasa, namun kurang secure karena password akan terlihat (sbnarnya kita bisa siasati ini) :

rsync -avzh --rsh="sshpass -p '<password>' ssh -l <hostname> -p<portnumber>" <ip_address>:/<sources_path>/* /<destination_path>/

Enjoy

Advertisements

Tinggalkan pesan atau komentar

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