0

If I am working in a terminal that is currently SSH logged in to a remote server user@node, and I want to transfer a file from local to that same server, I will run:

scp you@your_local_machine:/home/you/"FileName.csv" user@node:"~/folder"

It'll then ask for my local machine's login password. This is fine, but is there a way that I can modify the above scp call to automatically enter my password to the terminal instead of needing to type it in manually?

1
  • 2
    You can setup ssh keys so that you can use passwordless logins.
    – Lawrence
    Nov 13, 2013 at 5:07

1 Answer 1

3

SSH (Secure Shell) can be set up with public/private key pairs so that you don't have to type the password each time. On the local machine,type

ssh-keygen -t dsa 

To get the key on the server, you have two choices:

  • Use ssh-copy-id (standard with most Linuxes), e.g. ssh-copy-id user@server
  • Paste the content of the local ~/.ssh/id_dsa.pub file into the file ~/.ssh/authorized_keys on the remote host.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .