Only the public key is copied to the server. The copying may ask for a password or other authentication for the server. Not sure I can force the issue with root password from the customer. Use a command like the following to copy SSH key: ssh-copy-id -i /.ssh/mykey userhost This logs into the server host, and copies keys to the server, and configures them to grant access by adding them to the authorizedkeys file. When I try to login or ssh-copy-id from the remote server I am getting "Permission denied (publickey)."ĭoes anyone have any ideas what else I need to do? Changed to PAM.d? Once the public key has been transferred over of course I can install the software and then as an extra precaution I'll delete the public key and revert to defaults (most likely will disable root password as well since that's actually not required to run the software after install).ĭoes anyone have any ideas on this one? I'm at a loss. The software is trying to run an ansible script so I would be running an install shell script without an ask-pass option. user on the remote host might not own their home directory, not have enough permissions in it or, in this case, as outlined in the other comments, not have execute permissions on. leif is local and ssh-copy-id wouldnt create a. Either: copy /root/.ssh/ided25519 to your normal user. obvious answer would be that 'user' does not have write permissions to 'leif' directory. You dont need to use your local root to connect to a remote root user. You could use sudo ssh-copy-id -i /root/.ssh/ided25519 root192.168.134.140 However, you should not do that. But I figured I could modify sshd_config to disable temporarily password requirement for root over an ssh session so that I can ssh-copy-id then disable this functionality again. The file /root/.ssh/ided25519 is only accesible by root and that is why you get a Permission denied. Perhaps it's age catching up with me (most likely). So my thoughts are that in order to install the software I can create a public key on server 1 but I need to get it over to server 2 to the root instance. I have been given an account with sudoer priveleges. I was sure that I set all the permissions correctly using chmod. Just undo the changes in the /etc/ssh/sshdconfig, then restart the SSH service again. I had the same problem: ssh-copy-id gives the error Permission denied (publickey) on an AWS EC2 instance. 3.5 disable the password authentication of SSH service. ssh ssh-copy-id -i idrsa.pub email protected Everything should be ok now. Unfortunately for me the customer does not provide root access. 3.3 restart ssh service service sshd restart 3.4 retry the ssh command. However to do this the app also needs to ssh to the second server as root. The app runs on one server and installs to another. I'm trying to install some software on site at the moment and having a hell of a time with it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |