Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a solution that allows automatic SFTP user/password login?

I thought that was possible just by putting a .netrc file in $HOME but unfortunately it's not working on SFTP.

Has anyone else faced this problem?

share|improve this question

SFTP is based on SSH, so you can use the standard SSH key files. See ssh-keygen(1) and ssh_config(5).

If you're dependent on password authentication you could use another SFTP client like lftp or curl to which you can provide the password through a command line parameter or configuration file.

share|improve this answer
in this case i have to use user/password instead of key authentication – achraf Jul 19 '10 at 15:13
You could use lftp or curl, see edit. But IMHO the correct solution[tm] would be using SSH keys. – joschi Jul 20 '10 at 6:10
thanks i finally used key authentication way. – achraf Jul 26 '10 at 8:20

Your Answer


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.