Your best friend for file transfer.

Fetch application logoFetch

SFTP with public key - how? (39 posts)

  • Started 14 years ago by Franz
  • Latest reply 4 years ago from Pete
  • Jim Matthews Administrator

    Hi Pete,

    Thanks for posting that. As you can see from the ssh output, ssh is trying all the public keys in your /Users/Dad/.ssh folder, but none of them are working. Is one of them the one that should work? Have you put the corresponding public key on the server?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 4 years ago #

  • Pete Member

    I've used the same private key file in other FTP clients and they are able to connect so I assume the public key is installed on the server.

    One difference however is that there is a password associated with the private key file but I don't see a place to define that in my config file. The site I'm trying to connect to is on AWS in case that makes a difference.

    Posted 4 years ago #

  • Jim Matthews Administrator

    Hi Pete,

    Based on the transcript I'd guess that the private key you want isn't currently in your .ssh folder. That's where it would need to be to work with the command line ssh command, or with Fetch.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 4 years ago #

  • Pete Member

    That confuses me. The reminder of this thread indicates that entries in the .ssh/config file define the path to the private key file for each hostname. Are you saying the private key files themselves must be in the .ssh folder?

    Posted 4 years ago #

  • Jim Matthews Administrator

    Hi Pete,

    I apologize for the confusion. ssh and Fetch will try every key in the .ssh folder, so putting it there is one way to go. The other way is, as indicated earlier in this thread, is to put a reference to it in the config file. In your case it would look like this:

    Host dev.kleenedge.com
    HostName dev.kleenedge.com
    Port 1010
    IdentityFile path-to-the-keyfile

    You'd replace "path-to-the-keyfile" with the path to the private key file.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 4 years ago #

  • Pete Member

    Hi Jim,
    Thanks for the clarification. I moved the .pem file into my .ssh folder but still no joy with either ssh or from within Fetch. Got permission denied message both places.

    The weird thing is, I am able to connect to the same site using exactly the same .pem file in my .ssh folder using a different ftp client.

    The only thing I can think of is that the Amazon site I'm connecting to is locked down to specific ip addresses. That doesn't explain why the other ftp client can connect, unless maybe Fetch uses a different ip address than the machine it's running on which seems unlikely.

    Posted 4 years ago #

  • Pete Member

    I finally got this working in ssh. My config file looks like this:

    host aws
    HostName <hostname>
    User <username>
    port 1010
    IdentityFile ~/.ssh/<pkfilename>

    As you can see the private key file is in my .ssh folder.

    The ssh command is ssh -v aws

    I was prompted for the private key file password and got a successful connection. If I omitted the User parameter, the connection failed.

    Bad news is, I still get a Permission denied error when I try the connection within Fetch. Does Fetch keep a log file I could check?

    Edited 4 years ago #

  • Jim Matthews Administrator

    Hi,

    If you choose Fetch Transcript from the Window menu after trying to connect you'll see a log of the attempt. If you send it to bugs@fetchsoftworks.c&#11bugs@fetchsoftworks.com I'll take a look as well.

    To get more debugging information in the transcript, hold down Command, Option, Shift and Control, and type the letter "d". That should make a Debug menu appear in the menu bar, next to the Help menu. Choose Debug > Logging > SFTP log to enable additional SFTP logging to the transcript window.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 4 years ago #

  • Pete Member

    Thanks Jim. About to email the transcript and also the output of my ssh -v aws command gor comparison and my config file.

    Posted 4 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.