Link to home
Start Free TrialLog in
Avatar of Bill Herde
Bill HerdeFlag for United States of America

asked on

Need to set up SSH key login

A new client wants us to send them data using SFTP. They have asked for our public key.  We are not currently using SSH key authentication anywhere.  How can I set this up?  The data will be sent from a specific server only, and we currently send data to other clients using login\password authentication.
ASKER CERTIFIED SOLUTION
Avatar of Tej Pratap Shukla ~Dexter
Tej Pratap Shukla ~Dexter
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill Herde

ASKER

Thank you for your replies.
The sending app is a home-built application built on .net architecture. We have built in the hooks to send password authentication, and not being a programmer, I do not know what would have to change in that.
I also found the links to set this up using putygen.  Please confirm this would need to be done from the server that will be making the connection. (fortunately only one)  
Another caveat in this is that sometime in the next year we expect we may be sending data from this server for two company names, at the same recipient server.  We would be able to keep the data seperate using login names for authentication, but if the only authentication is a key, I need to confirm if there would be issues using multiple keys on the same server. (I would think not, but as I said, this is new ground for me.)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Let me give that t shot.  will get back to you.  Thanks.
Using puttygen I created a keypair and set up a user on the ftp server with key authorization.  I am using Ceberus FTP as the FTP host. This part I am pretty sure is done correctly as I have another client that connects with a public key and it is working.

I have been trying to use filezilla to test and educate myself on how it works.  I am unable to get it connected. The server is responding with "2015/01/11 07:02:29       [1068]       Disconnect reason: No supported authentication methods available"

I have tried loading the private key in pagent, I have tried adding it to the SFTP setting in filezilla.  The SSH connection type is selected, and I have tried every option for logon type.  I also found a reference to the puttygen string getting formatted when saving, and have made the public key file again by copy/paste out of the puttygen window.  Also noted that the client supplied pub files do not have the "begin ..." text at the start of the public key and tried a version that more closely resembled public keys that work.

Any ideas what I should be doing to get these keys to work?

reference links
http://askubuntu.com/questions/204400/ssh-public-key-no-supported-authentication-methods-available-server-sent-publ
https://www.digitalocean.com/community/tutorials/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps
https://wiki.filezilla-project.org/Howto
http://superuser.com/questions/180221/connect-to-server-using-sftp-and-public-ssh-key-using-filezilla-on-windows
pagant should work - I use that method myself; also, if you don't have a password set on the putty private key, you can add it directly into the filezilla setup (Connection -> SFTP and "add keyfile" - needless to say, this doesn't work if there is a password set on the keyfile.)

Public keys for openssh use (the most common) do not begin with "begin..." - those are for commercial ssh - if you need those, then you should use the menu option "save public key" in puttygen - otherwise, the text box in puttygen labelled "public key..." and containing text beginning "ssh-rsa" or "ssh-dsa" is the openssh key, and should be cut and pasted from that box to send to the server's owner.

in filezilla, you should select the protoocol sftp and logon type normal, leaving the password field blank. The fact you are getting the "no supported auth" error should indicate that you got this correct, although the refusal to honour the pagant is puzzling, and it is more likely that the error is at the remote (server) side.
The final issue was the simple stuff.  I had typo'd the username on the filezilla site setup.  Must have looked at it 50 times before I saw the missing letter.

Thanks for all the help.  Puttygen was easy to use to create the keys.  Filezilla and Pagent work well enough to get the job done.  I like it best with the apps installed so the .ppk files associate with Pagent.  That saves some clicks and complexity for the users.  Filezilla running from a shared location on the terminal server will keep me from having to set up for multiple usrs, but I have not tested if it will cause an issue with more than one user hitting it at a time.  Users will not be an issue once the parser takes over the job.

So now I have another tool on the bat belt.

Thanks again.