Score:1

setup SSH access for another user without sending him the private key [Ubuntu 20.04]

pn flag

I need to abilitate ssh access on a server for another non-root user (I am root). I have created a ssh pair for him on the host, copied the public one in his ~/.ssh directory as .ssh/authorized_keys and setup the permissions as follow:

sudo chown -R username:username /home/username/.ssh
sudo chmod 0700 /home/username/.ssh
sudo chmod 0600 /home/username/.ssh/authorized_keys

However login is not working for him. My question is: do I need to send him the private key? It seems to me that, logically speaking, the client should have the private key corresponding to the public key on the host, but I am pretty sure I have been given ssh access to servers without administrators sending me private keys (which would be quite bad for security).

muru avatar
us flag
Usually, the person who will be accessing the server will generate a keypair, send the admin the **public key** and the admin will add that to the authorized keys. The admin generating the keys is a no-no.
A.Manfreda avatar
pn flag
Can I at least abilitate password ssh login for him (without keys)?
muru avatar
us flag
You are the admin, right? Then it's for you to decide whether you want to allow password login for them or not. Or check if your organisation has policies allowing it.
A.Manfreda avatar
pn flag
Ho do I do that? Do I need to edit the ssh_config file? Does the client need to do any configuration on their side? I tried a few things found online but nothing seems to work.
muru avatar
us flag
The default is to allow password login for everybody except root. So if you haven't changed that and the user account isn't locked, they should be able to login with the password.
A.Manfreda avatar
pn flag
Unfortunately that does not seem to work. I will ask a different question.
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.