Skip to main content

SSH with Certificate does not work with local client

Comments

14 comments

  • cPRex Jurassic Moderator
    Hey there! You'd want to move the public key to the remote location - the private key is the portion that should not be moved. According to the SSH docs, "Authorized keys are public keys that grant access. They are analogous to locks that the corresponding private key can open."
    0
  • JIKOmetrix
    Yes, correct. I need dev.user to be able to ssh into live.user. On the live.user cpanel I created a key pair. The public key is activated on live.user and remains in live.user .ssh folder. I then placed the private key in dev.user .ssh folder with 0600 permissions. [QUOTE]Can you try using the public key in the .ssh/authorized_keys file to see if that gets things working?
    I do not follow the above comment. I thought only the live.user needed to have .ssh/authorized_keys set for the public key? Are you saying the dev.user neeeds this too? Live I said, this work as expected from desktop computer connecting to live.user with private key. What does not work is going to a terminal prompt for dev.user and trying to ssh from dev,.user to live.user file space.
    0
  • cPRex Jurassic Moderator
    This is one of those (it should just work) and isn't dependent on cPanel tools as this is purely SSH. My only recommendation would be trying to create a new key and seeing if that changes the error message at all.
    0
  • JIKOmetrix
    This is one of those (it should just work) and isn't dependent on cPanel tools as this is purely SSH. My only recommendation would be trying to create a new key and seeing if that changes the error message at all.

    Yup, new key does same thing. I'll have mot move the dev site to the same file system account as live so they I can use rysnc without having to login. Thanks
    0
  • JIKOmetrix
    I'm going to try this SCP - Example syntax for Secure Copy (scp) and see if that will work.
    0
  • JIKOmetrix
    I get same error using scp: Load key "/home/brightro/.ssh/id_rsa_dev2": invalid format
    0
  • cPRex Jurassic Moderator
    It's time to make a ticket for this one - I'm sure once we see the system we'll be able to recommend something.
    0
  • JIKOmetrix
    Hello, okay, I'll open a ticket today.
    0
  • JIKOmetrix
    Hello, I did more googling and research on this. I found this post.
    0
  • cPRex Jurassic Moderator
    You can create a key without a passphrase - I do that all the time for migration work.
    0
  • JIKOmetrix
    You can create a key without a passphrase - I do that all the time for migration work.

    The cPanel ssh key manager requires a password when creating new key pairs. I'm guessing that I'd have to do this via command line?
    0
  • cPRex Jurassic Moderator
    Yes - when you create the key and it asks for the passphrase on the command line, just press enter to leave it blank.
    0
  • JIKOmetrix
    Yes - when you create the key and it asks for the passphrase on the command line, just press enter to leave it blank.

    Thanks. I'll try that for this project.
    0
  • JIKOmetrix
    One more comment on this topic. I had run into a situation where I had the rsync working with the ssh key via command line, but is would not execute in a perl script. I had needed the execution from a private web page interface. It turns out you have to escape the '@' symbol in the perl script to get to work or it throws an error [QUOTE]$system_call = "rsync -avz --delete --exclude-from /home/user/exclusion.txt /home/user/public_html/ -e 'ssh -p 123 -i /home/user/.ssh/id_rsa' user\@127.0.0.1:/home/user205/public_html/"; `$system_call`;
    You can see the user\@127.0.0.1 has the escaped '@' symbol.
    0

Please sign in to leave a comment.