Firefox 16, a treat for developers http://t.co/cnd27CzT
scp- secure way to copy files over ssh
The SCP protocol, which runs on port 22, is similar to the BSD
rcp protocol, however unlike rcp, data is encrypted during transfer,
to avoid potential packet sniffers extracting usable information
from the data packets. The protocol itself does not provide authentication
and security; it relies on the underlying protocol, SSH, to provide these features.
You can use scp to copy files between remote hosts using secure a connexion.
Just like the cp command, scp will overwrite an existing destination file. In addition, if the destination is an existing directory, the copied material will be placed beneath the directory.
How to use scp
The general form of the command is:
scp source-specification destination-specification
where source-specification indicates which file or directory is to be copied, and destination-specification
indicates where the copied material is to be placed.
1 – Copy files to a remote host X and from the remote host X to my computer (Host Y) :
For example , I want to copy the file sim.log from my computer (Host Y) to the folder /tmp on
the remote host X
Copy file to a remote host :
zinovsky@unixmenhowtos:~$ scp /home/zinovsky/sim.log root@remotehost-X:/tmp
root@remotehost-X’s password:
sim.log 100% 873 0.9KB/s 00:00
zinovsky@unixmenhowtos:~$
Copy a file from a remote host X to host Y (my computer) :
Now I will copy the file sim.log from the remote host X to the desktop of my computer :
zinovsky@unixmenhowtos:~$ scp root@remotehost-X:/tmp/sim.log /home/zinovsky/Desktop
root@remotehost-X’s password:
sim.log 100% 873 0.9KB/s 00:00
zinovsky@unixmenhowtos:~$
2- Copy a folder to a remote host or between 2 remote hosts :
Example : I want to copy a folder called -salamon – from my desktop to the folder /tmp on the remote host X :
scp -r /home/zinovsky/Desktop/salamon root@192.168.123.191:/tmp
root@192.168.123.191′s password:
zinovsky@unixmenhowtos:~$
To copy a folder called unixmen from the remote host X to to the desktop of my computer where i`m connected :
scp -r root@192.168.123.191:/tmp/unixmen /home/zinovsky/Desktop/
root@192.168.123.191′s password:
zinovsky@unixmenhowtos:~$
Now you can use the same described above to copy files and folders between 2 remote hosts.
So while you are connected to remote host X you can copy files and folders to remote host Y.
Here are some Options :
-P port
Specifies the port to connect to on the remote host. Note that
this option is written with a capital ‘P’, because -p is already
reserved for preserving the times and modes of the file in
rcp(1).
-p Preserves modification times, access times, and modes from the
original file.
-q Quiet mode:
disables the progress meter as well as warning and
diagnostic messages from ssh(1).
-r Recursively copy entire directories. Note that scp follows sym‐
bolic links encountered in the tree traversal.
-S program
Name of program to use for the encrypted connection. The program
must understand ssh(1) options.
-v Verbose mode.
Causes scp and ssh(1) to print debugging messages
about their progress. This is helpful in debugging connection,
authentication, and configuration problems.
The scp utility exits 0 on success, and >0 if an error occurs.
You can lean more about scp and scp commands by typing this command on the terminal :
man scp
If you need any help, the doors of our forum is always open.
Like us on Facebook
This week Top Posts 
Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
Scan Your Home Network With Nmap : Who should read this article? Everyone who is interested in computer security and computer networkin...0 comment(s) |
How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comment(s) |
Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
Recent Posts
- Secure File from Removal in Linux and Unix
- How to Install Nginx on FreeBSD 9.x
- Create a Launcher in Ubuntu Using Bash
- Scan Your Home Network With Nmap
- Steganography- Hide Your Files Inside An Image in Linux
- Unix/Linux File Recognition. Did You Know?
- Migrate from MySQL to MariaDB in FreeBSD
- Connect Your Android Galaxy Tablet to Ubuntu via USB
- ElementaryOS Beta 1 and 2 Comparison and Review
- Introduction to the Linux Command Line
Recent Comments



















Blawer
| #
Thanks!!!!!!!!!!!!!!!!!! you rules!!! all the other “help” in google are useless… yours was very helpful. Thanks again
piCool
| #
Great ! we have another another master trick :-)
Yilmaz Ulugtekin
| #
Just delete the space after the slash (/) it will work.
Pat L
| #
I tried it and it works with a regular zip file, but if you password-protect the .zip file it does NOT work.
SK
| #
Yes we can. What kind of help you need? We are doing outsourcing and technical support for Linux and Open source worldwide. To know more about the details visit here.