Results 1 to 6 of 6
I need to connect to an sftp-site with a private/public key combination. I've sent my public key to the site administrator and can connect with FileZilla without any problems. Within ...
- 12-15-2011 #1Just Joined!
- Join Date
- Aug 2005
- Posts
- 9
FileZilla works, SFTP not
I need to connect to an sftp-site with a private/public key combination. I've sent my public key to the site administrator and can connect with FileZilla without any problems. Within FileZilla I specified the location of my private key in the SFTP-settings.
I would like to automate my FTP commands in a script, so my next step was to try sftp.
I tried sftp with the -i option referring tot the private key file. I've also tried to copy the private key file to the .ssh-directory and chmod the key file to 600.
But each time sftp requires a password after connecting, whereas FileZilla works out-of-the-box.
Can you help me to solve this so I can consider scripting my downloads?
Tx for your help
Ivan
- 12-15-2011 #2
Try using -b or whatever batchfile option you have available. Consult the man pages for more info about the exact option.
The batchfile should contain the line-by-line commands you would pass to the server (username, password, etc.) Below is an example of what might be in the batch file.
Code:myusername mypassword cd some/directory put somefile quit
linux user # 503963
- 12-19-2011 #3Just Joined!
- Join Date
- Aug 2005
- Posts
- 9
Tx for your reply, but I cannot login. The system keeps asking me for a password, even if I provide the private key file.
In FileZilla it is working, but I want it to make it work in scripting.
- 12-19-2011 #4
As in login with a password or you put a password in your private key?
linux user # 503963
- 12-19-2011 #5Just Joined!
- Join Date
- Aug 2005
- Posts
- 9
When generating the public and private key, I entered a passphrase. But the first time I've used FileZilla, FZ asked me the passphrase to unlock the private key so I could save the unlocked private key.
When using FileZilla that uses this unlocked private key, I have no problem logging into the sftp-site.
But when I want to use this unlocked private key with "sftp -i unlock_private_key.ppk user@host.com" sftp asks for a password. I've tried to chmod 600 the private key file, but this didn't help.
Ivan
- 12-19-2011 #6Just Joined!
- Join Date
- Aug 2005
- Posts
- 9
SOLVED
I had to convert the private key file-format (PPK) to an OPENSSH-format.


Reply With Quote