Score:0

If I setup a 'Passwordless SSH connection' as root user, will it be applied to all other users on the server?

vn flag

I'm new to the concept of SSH & password-less authentication.

I'm trying to setup password-less SSH connection between two servers A & B, using SSH-keygen.

If I generate the keys on "Server A" as "root" user, can all the other users on "SERVER A" use the password-less SSH connection?

(or)

Do I need to create separate keys for each and every user?

I'm trying to set up password-less SSH connection for a set of specific users, including root user.

jp flag
You need to create ssh keys for each user.
Score:0
it flag

No, generating key pair for root user is not "applied" to other users.

You can generate one key pair and then copy the same public key to any user's ~/.ssh/authorized_keys of the computer you need to access. That way you can connect everywhere through the same user@computer. To other computers also. Or even from other users and computers if you copy the private key (don't!). But that's not a good practice, security wise.

I'll to explain the process in simple terms.

  1. Generate key pair on the client computer, where you'll execute the ssh command; by the user you want to use to ssh. Not necessarily need to be generated there (or by a certain user), but it's simpler that way.
  2. Copy the public key only you generated to the computer you want to connect through ssh and to the user of that computer. ssh-copy-id essentially does something like this:
cat ~/.ssh/id_rsa.pub | ssh user@computer 'cat >> ~/.ssh/authorized_keys'

Have in mind that you can arbitrarily connect from any user@computer1 to any user@computer2. No need to connect root to root for example. Crucial point, copy or transfer with whichever method the public key only. The private key must not be transfered, copied or gained access by someone you don't want to.

I used the term computer instead of client/server because most Linux systems have sshd (server) and ssh (client) installed by default nowadays. So you can use ssh to connect and administer from server to server, or even from a server to a client.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.