Sunday 4 November 2012

How to copy a file over the network

How to copy a file over the network?

 

To copy the files over the network in ubuntu the first step is to determine the ip address of the ubuntu machine where we are sending file to:

192.168.0.25

or the DNS name of this computer, for example:

bill-server


Then we have to know the username and password of the user on the destination machine where we are going to copy the files to:

username: chris
password: ****

Then we use scp  command. The structure of the command looks as follow:

scp /path/to/the/file username@IP.ADD.OF.HOST:/path/to/the/destination/directory/

for example:

scp /home/phil/Desktop/CV.pdf chris@192.168.0.25:/home/chris/Desktop/

Then we are asked to type in the password for user chris on 192.168.0.25

chris@192.168.0.25's password:

In case if working DNS the situation in similar, but instead of using IP address we use DNS name of the remote host:


scp /path/to/the/file username@NAME-OF-REMOTE-HOST:/path/to/the/destination/directory/

for example:

scp /home/phil/Desktop/CV.pdf chris@bill-server:/home/chris/Desktop/

No comments:

Post a Comment