I am trying to accomplish passwordless ssh-ing from root. To be clear, I want to log in from the local machine at root to a /home/user folder on remote. Have established the connection between user@local to user@remote, but can't figure out how to allow root to connect.
Asked
Active
Viewed 4,356 times
1 Answers
1
First of all, known_hosts is not the file that you want to copy. That is just a list of all the systems that have been connected to to check if the system might have changed or a man-in-the-middle attack is being attempted.
For password less connections, you need a id_rsa file in .ssh folder. You can copy the file and make sure is has the correct permissions. 600 for the file
or better, create a new key for root to use. sudo up to root. create the key and then copy the id_rsa.pub contents to the authorized_keys on the remote system. there are steps in the link below.
ssh-keygen -t rsa
Or create your key as Root then use ssh-copy-id command, it will add the files where they need to be.
ssh-copy-id user@hostname.example.com
grag42
- 236