S
S
Sergey Karbivnichy2020-11-18 16:32:44
linux
Sergey Karbivnichy, 2020-11-18 16:32:44

Created a user in Ubuntu, but the password doesn't match?

I created a new user on the server (Ubuntu 18.04), but I can't sudo because the password is wrong. At first I thought that I set the wrong password (which is unlikely, since I entered the password 2 times). Deleted the user and recreated (set the password the same as root):

adduser sergey
usermod -aG sudo sergey
su - sergey
next:
sudo ls
and here:
[email protected]:~$ sudo ls
[sudo] password for sergey: 
Sorry, try again.
[sudo] password for sergey:

The password is 100% correct because the hashes in /etc/shadow are the same as root. I have done this many times, but apparently I missed something and forgot. Although I looked at the article on DigitalOcean - everything is the same there. I know in Debian you need to crutch to add a user to sudo (at least I had this on the desktop)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-11-18
@hottabxp

This helped:
passwd sergey
PS: Weird, someone just gave an answer here, but then I refreshed the page and the answer was gone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question