Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to copy a file from my Ubuntu Desktop(user:vverma) to a server named fb3, please guide me regarding how to scp this?

In order to reach fb3, i have to follow these steps:-

  1. ssh to server1 as user1 from my terminal
  2. ssh from server1 to server2 as user1
  3. sudo su - user2
  4. ssh from server2 to server3(which is fb3) as user2

Now please guide me that how can i accomplish this complicated tsak without creating any errors.

share|improve this question
    
I am basically stuck at step 3 where i have to switch from user1 to user2 on server2, i don't know about the priveleges of these two users on server2, so where to paste the file on server2, which one is the directory which will be common to both users on this server –  vipin8169 Sep 21 '12 at 10:07
    
Why do you have to do step 3? You can always ssh / scp using username@server; you can always copy the authentication keys if necessary. –  January Sep 21 '12 at 10:46

4 Answers 4

up vote 1 down vote accepted

I have always did it like this:

rcp filaname usernameinserver@server:path/in/server

The command will ask you for your password on the server (unless you are using another authentication schema).

Note that your user name in the local computer is not relevant.

rcp/scp are tunneled under ssh, it's probably the most secure way to copy a file. If you want increased security you can try to use key pars instead of passwords. It's more complicated to setup but after it's done you don't need to type your password for each transfer.

share|improve this answer

You can try rsync.

rsync -v -e ssh ~/Desktop/filename username@server:/path-in-server

Take a look at this page

share|improve this answer

You can make a shared folder in the server then connect to the server and copy to the shared folder then you can remove sharing from the folder

share|improve this answer

there is absolutely no reason to be paranoid about ssh/scp, why should you be? It's safe.

scp myfile user@ip_or_server_name:path/to/myfile

path can be either relative or absolute

I assume that you have already generated your keys (ssh-keygen) and copied to your server (ssh-copy-id).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.