User locked out of SSH

I had created a non-root user for my openwrt router. However when I was logging in with that user I was getting the message Failed chdir '/home/user1': No such file or directory, so I decided to create a home directory for the user:

sudo mkdir /home/user1
sudo usermod --shell /bin/bash --home /home/user1 user1
sudo chown -R user1:user1 /home/user1

Now when I tried to login back with ssh to test, the user's password does not get accepted. Fortunately I was able to enable root ssh login through luci, logged in as root and changed the password for the user:
passwd user1

However this still didn't solve the problem and user1 is still unable to login.
Any ideas?

What is the error now?

Do you have the bash shell installed?

4 Likes

good catch! I reran it using sudo usermod --shell /bin/ash and works now

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.