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.

so I need to connect to a remote server. Remote server is running Debian, I am on Ubuntu Lucid -- and a noob in SSH.

I need a public key to connect to the remote server. The key has been created as a PuTTY Pageant File (.ppk). I used putty-tools to convert the .ppk key to Linux files (namely, id_rsa and id_rsa.pub). SSH works okay, but when I try to SCP a file terminal says :

# scp -P 52 /path/to/local/file user@host.com:/path/to/remote/file

Permission denied (publickey).
lost connection

Also, it's not working using SFTP with FileZilla:

Command:    Trust new Hostkey: Once
Error:  Could not connect to server

How come it's working with SSH and not SCP? Thanks!

Edit: it's working now! Not really sure why... How is that passphrase system working with SSH? Does it keep the passphrase in th terminal's memory? This time I've connected to SSH in one terminal tab. I was prompted my passphrase, entered it and got in. Then on another terminal tab, I tried to scp a file and I've been asked the passphrase and it worked!....

share|improve this question
    
please provide more information. :) try and connect and add verbose tak. –  myusuf3 Feb 10 '11 at 18:00
    
Yes, please run scp with the -v option added at the start. And tell us how you are running the ssh that works. –  Mikel Feb 10 '11 at 20:19
    
it works now! not sure why but it does! How should I treat the question now? should i mark it solved? –  fabjoa Feb 11 '11 at 7:43

2 Answers 2

Is id_rsa in ~/.ssh? This is where ssh and scp looks for the private keys.

Also if your using a private key you shouldn't be prompted for a password, this would suggests that it is not being used, and also that it is not required.

I'm also confused as to why your using putty if both systems are Linux.

share|improve this answer
1  
Linux has built in SSH support: you can run ssh user@host and it will work. You don't need PuTTY to use SSH on Linux. –  Thomas W. Jul 18 '11 at 13:47

Following the advice of Mikel (thanks!) I ran with the -v option and received a stinging reminder that I was trying to run scp as root. Silly me, I had set up all the shared key credentials in the home directory of the non-root user.

After severely chastising myself, then going to /root/.ssh and copying three files from /home//.ssh, my efforts were met with success.

JBR

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.