How to copy files using SSH

Q: How to copy files using SSH or via putty ?   (Linux)

           To copy files/directories over secure shell SCP command is used. SCP (Secure Copy) provides secure file transfer between machines. and also features encryption while transfer. This cause little bit slow than regular ftp and other protocols.

Copy a file from remote linux machine to local machine
#scp user@ /home/new/Desktop/
user@'s password:     (now input password of user)
new.txt                                   100%  794     0.8KB/s   00:00
#The above command copies the file "new.txt" from the remote system(ip= to Desktop

 Copy a file from local machine to remote linux machine.

[root@server ~#]scp /new/Doc/new.txt  james@
james@'s password:     (now input the password of james)
new.txt                                   100%  324     0.8KB/s   00:00
#The above command copies the file "new.txt" from the local machine to  remote system with ipaddress
Note: If the username is not specified in the command, you will have to enter the root password of the remote machine. Can also transfer directories In the same way. 

How to Specify Port Numbers with SCP
         If the remote SSH server listens on a diffrent port than default 22/TCP. Then pecify that port number by using the " -P " switch. 
#scp -P 353 user@ /home/james/Desktop/
In the above command the remote servers( ssh port is 353/TCP

Was this helpfull ?


Chan PK said...

This is the simplest, clearest explanation of this topic I have found. Thanks!
linux scp

Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons