I have a user on my local (virtual) machine with sudo privileges and when I login with this user I can run SUDO commands such as:
$ sudo ls
[sudo] password for <user>: ***PASSWORD ENTERTED***
<list of files>
However when I SSH into the same machine I get:
$ ssh <user>@<ip-address>
<user>@<ip-address>'s password: ***PASSWORD ENTERTED***
.
.
.
[<user>@<host> ~]$ sudo ls
[sudo] password for <user>: ***SAME PASSWORD***
Sorry, try again.
[sudo] password for <user>: ***[CTRL-C]***
sudo: 1 incorrect password attempt
Any idea why this password isn't being accepted over SSH?
Not that it really matters, but I can "su" to root over ssh (by using the root password) but trying to su with "sudo su" (using the user's password) fails.
Edit: The machine I'm SSH-ing to is a CentOS 9 machine running in Virtualbox, and the machine I'm SSH-ing from is a Rocky 9 machine also in Virtualbox. As I say, I can SSH across fine and most commands work but for some reason SUDO is refusing to accept the password. However, I just tried "PuTTY" into the same VM from the Windows host and was surprised to discover than not only does the SSH session work, but SUDO-ing also works! So it seems there must be an issue with the Rocky (from) machine rather than with the CentOs (to) machine.
ssh
-ing) the shell echoes them exactly as you expect? Do all characters of the password get to a shell on the server machine so (afterssh
-ing) the shell echoes them exactly as you expect? I don't mean when providing the password. I mean when freely typing in a shell. Are there any characters outside of the ASCII printable set? What if you change the password to be all ASCII?cat -e
and just pasting something else into the terminal?