COPY SSH DENGAN SCP UNTUK CLIENT LEBIH DARI 1

2 Sep

Dengan SCP dapat melakukan copy ke server tujuan dengan client lebih dari 1 dimana user dan password tidak perlu ditanyakan lagi.

==================
client 1
==================
[onta@linux1 ~]$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ”
Generating public/private dsa key pair.
Your identification has been saved in /home/onta/.ssh/id_dsa.
Your public key has been saved in /home/onta/.ssh/id_dsa.pub.
The key fingerprint is:
e6:0c:77:2d:15:c3:09:72:85:e9:12:36:6c:60:4c:11 onta@linux1.localdomain
[onta@linux1 ~]$ scp /home/onta/.ssh/id_dsa.pub onta@linux3:linux1.tmp
onta@linux3’s password:
id_dsa.pub                                    100%  613     0.6KB/s   00:00

==================
client 2
==================
[onta@linux2 ~]$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ”
Generating public/private dsa key pair.
Your identification has been saved in /home/onta/.ssh/id_dsa.
Your public key has been saved in /home/onta/.ssh/id_dsa.pub.
The key fingerprint is:
e6:0c:77:2d:15:c3:09:72:85:e9:12:36:6c:60:4c:11 onta@linux2.localdomain
[onta@linux2 ~]$ scp /home/onta/.ssh/id_dsa.pub onta@linux3:linux2.tmp
onta@linux3’s password:
id_dsa.pub                                    100%  613     0.6KB/s   00:00

==================
server tujuan
==================
[onta@linux3 archive]$ chmod 700 /home/onta/.ssh
[onta@linux3 archive]$ cat ~/linux1.tmp >> authorized_keys
[onta@linux3 archive]$ rm  ~/linux1.tmp
[onta@linux3 archive]$ cat ~/linux2.tmp >> authorized_keys
[onta@linux3 archive]$ rm  ~/linux2.tmp

=======================
test scp dari client 1
=======================
[onta@linux1 ~]$ scp /u01/archive/*.dbf onta@linux3:/backup/archive
1_3040_649098782.dbf                          100%   22MB  22.3MB/s   00:01
1_3041_649098782.dbf                          100%   45MB  45.0MB/s   00:01
1_3042_649098782.dbf                          100%   45MB  45.0MB/s   00:01

=======================
test scp dari client 2
=======================
[onta@linux2 ~]$ scp /u01/archive/*.dbf onta@linux3:/backup/archive
2_3040_649098782.dbf                          100%   22MB  22.3MB/s   00:01
2_3041_649098782.dbf                          100%   45MB  45.0MB/s   00:01
2_3042_649098782.dbf                          100%   45MB  45.0MB/s   00:01

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: