Update a Debian user's password and passkey and grant sudo access
For a user named agaric:
sudo passwd agaric
From a different server with working id_dsa public key that had been cat'd into authorized_keys:
scp authorized_keys ben@example.org:~
Then back on the server to which we're updating this user, from your own home directory to which you just uploaded the authorized keys file.
sudo mv authorized_keys /home/agaric/.ssh
Alternatively (and more likely your situation), get and upload the user's public key, and cat it into authorized_keys, creating that file if necessary. (See creating SSH keys.)
... but, our user still cannot login without a password.
i cannot change the owner of the authorized_keys file. perhaps that's the root of the problem.
To which I responded:
blast! i swear this is documented on Agaric somewhere, i remember this now
ben@example.org:/home/agaric/.ssh$ ls -la
ben@example.org:/home/agaric/.ssh$ sudo chown agaric:agaric authorized_keys
ben@example.org:/home/agaric/.ssh$ ls -la
I let our user know:
ok, it's changed to being owned by you
Test successful!
Now the public key login works.
What else is there to say?
awesome
Now that the user has a secure public key, let's give them sudo privileges.
Adding a user to sudo access, the sudoers file:
Not this way:
sudo vi /etc/sudoers
# This file MUST be edited with the 'visudo' command as root.
This way:
$ su root
visudo
Comments
SSH
thanks ben <3
Post new comment