Welcome to the Linux Foundation Forum!

[useradd] ssh impossible even after setting a password

The steps are:
1. create a user with useradd
2. try to ssh with a fake password three times to have a Permission denied
3. set a password to the user
4. retry to ssh with the right password: it should fail no matter what password is set

The new attemps to connect with ssh fail forever afterwards (under Arch at least...). Is it just me? On two users, I observed the same behaviour.
If the password is set before the ssh attempt or if a fake password is not given three times, then ssh works as expected


  • coop
    coop Posts: 913

    I do not know what you are trying to do and this stuff (often involving pam) is often not distribution flexible. Please try on a supported distro which Archlinux is quite definitely not as it is often idiosyncratic as compared to the main supported ones.
    (i.e., you lost my attention at "Arch")

  • In Ubuntu 20.04.2 LTS (Focal Fossa), the ssh command doesn't work in either cases.
    The sshd server is running as shown with systemctl status sshd, but impossible to login with ssh user1@localhost or ssh user1@ipaddress even when the password has been set.
    The command su user1 works though

  • coop
    coop Posts: 913


  • coop
    coop Posts: 913

    this has been volatile on all recent distributions as Red Hat has removed the pam module for doing this and each distro has now different methods. So we removed mention of it in the courses as being too convoluted


Upcoming Training