0

My admin account was added to sudoers and worked fine. I set up SSH and xRDP on my computer. I used the exact same username for these programs. Now when I try to sudo, it says my user is not in the sudoers list. I can switch to root, but that doesn't fix my problem.

What I think happened is that when I log in as the user, it's using my SSH login. If I'm correct, how do I log out of the SSH user if the usernames are the same. But maybe I'm wrong and something else is going on.

Also: when I try to add the user to sudoers file, it says the user is already added

EDIT: I'm not 100% sure that it has anything to do with xRDP or SSH. I started having the issue afterwards, but it may be unrelated. Also, I don't think I created a new user, just added the existing user; but I am not sure about this either.

9
  • last comment maybe askubuntu.com/questions/1325692/…
    – amar
    Commented Jul 8 at 19:13
  • 2
    So... when you set up ssh, you created a new user account with a non-unique (i.e. same as an existing) username? How and why exactly? Commented Jul 8 at 19:17
  • @amar I tried the the last comment on that thread and it didn't work for me.
    – AK86
    Commented Jul 8 at 20:10
  • @steeldriver I'm not 100% sure if a created a new account. I probably just added the user account.
    – AK86
    Commented Jul 8 at 20:11
  • 1
    It's going to be hard to help without knowing exactly what you did - fyi on Ubuntu systems it would not be typical to add users directly to the sudoers file, it's generally done by adding them to the sudo group (which already has an entry in the file). Commented Jul 8 at 20:23

1 Answer 1

1

Adding a userid to /etc/sudoers is an obsolete method of allowing sudo access, as /etc/sudoers got replaced by your installations. Rather, add your userid to the sudo group with (as root) adduser your_userid sudo, then logout your_userid completely and login (groups are applied by login.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .