I have a user without a password set (i.e. passwd -d
).
I would not like to use public keys on this setup.
Is there a way to SSH login to such a user?
I have a user without a password set (i.e. passwd -d
).
I would not like to use public keys on this setup.
Is there a way to SSH login to such a user?
PermitEmptyPasswords yes
then restart sshd ?
PermitEmptyPasswords yes
doesn't let the user with an empty password set login, even after a reboot.
Feb 12, 2014 at 6:42
ssh
to /etc/securetty
for this to work.
If you just want to become the user in question, the simplest way is to log in as some other user (via ssh) and su $username
. This requires root privilegies, but you could put the command in /etc/sudoers
and only let your user execute that command as root.
If you really want to login through ssh (or remotely in some other way), you need to pick one of the following:
su
is not sudo
2) with sudo
the "as root" does not apply. While using su
is an option, I (as a former Unix sysadmin) would rather see a focus on the use of sudo
.
Jan 31, 2012 at 11:07
sudo
does not look like logging in as or switching to a user, su
does. The op wanted to log in as some user, not execute commands as it. 2) sudo
lets you execute commands as another user (see man sudo
if you don't believe me). In this case you would like to execute su
as root to avoid having to give a password for the user you switch into. 3) Different tools for different tasks, although I guess some people have higher tolerances than me for typing sudo -u postfix
before their actual commands.
You need to do all of the following:
PermitRootLogin yes
and PermitEmptyPasswords yes
in
/etc/ssh/sshd_config
StrictModes yes
in /etc/ssh/sshd_config
ssh
to /etc/securetty
service ssh restart
PermitRootLogin yes
) AND empty passwords (PermitEmptyPasswords yes
).