0
I am trying to set up a very simple bash script on Ubuntu that SFTPs to a specific server using public key authentication. When I run the command directly on the command line, it works like a charm:
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/xxx/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
When I place the same command in a bash script and then run that script, the public key is not accepted and it goes to next authentications.
debug1: Offering RSA public key: /home/xxx/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: password,publickey,keyboard-interactive
The command I am trying to run is very straightforward, nothing fancy about it:
sftp -vvv user@domain.com
Any ideas of what is causing this?
Not enough info on the client side, you should look at the logs server-side, and paste that info here. – MariusMatutiae – 2015-12-02T08:45:40.230
is the private key passphrase protected? Isn't it provided by
ssh-agent
? – Jakuje – 2015-12-02T17:53:57.167