How to enable the Non-root user to access the ssh

Currently, We are using v19.07.07 and Dropbear v2019.78. We supposed to access the ssh via Non-root user.

I have created the user as engineer and those information as below. But i unable to ssh with user(engineer)

# cat /etc/passwd | grep engineer
engineer:x:1002:0:engineer:/home/engineer:/bin/sh

# cat /etc/shadow | grep engineer
engineer:$6$hbj63kKha/Sg0LK$tE0Rkw.8P.D.c507kvAMncnmAt.f2HQyyViRTtcSHqE4YQCX6a9nnuBITrpKiYEFugql8OUd603xQMAQblHjy.:19089:0:99999:7:::

This is not all you need to create to make it work.

Your password hash uses the SHA-512 algorithm ($6$...) which is not supported in default builds of OpenWrt 19.07. You need to use an MD5 hash ($1$...).

Also ensure that /home/engineer exists, is a directory and belongs to engineer.

2 Likes
  1. We tried with md5 hash and it also not working. It looks access denied and refer below snippets

cat /etc/shadow | grep engineer

engineer:$1$pAyILKJ0$iGY7Q.xiyFdL4RBsOhCWd/:19104:0:99999:7:::

login as: engineer
Access denied
engineer@192.168.1.1's password:
Access denied
engineer@192.168.1.1's password:

  1. Earlier , We have used as like root user. Shall i know How it works for root user

cat /etc/shadow | grep root

root:$6$wPIQB9xrSq/.Pq/$BFMV7WnSiy7DHFdmmrp46AxWxERdrznxzyYicmXQkUzcGMr9Z7O9nLMxyi.bxPYR/a2xTdbeRmY5SUahtfCZU.:19104:0:99999:7:::

What's the output of the following commands?

  • grep engineer /etc/passwd
  • grep engineer /etc/shadow
  • ls -lha /home
  • ls -lha /home/engineer/.ssh
root@Openwrt:/# echo "engineer:abcdefghi" | chpasswd -m
root@Openwrt:/# grep engineer /etc/passwd
engineer:x:1002:0:engineer:/home/engineer:/bin/sh
root@Openwrt:/#
root@Openwrt:/# grep engineer /etc/shadow
engineer:$1$rnSvs/kT$/WxZb59I2DV6mygUb7vzK1:19104:0:99999:7:::
root@Openwrt:/#
root@Openwrt:/# ls -lha /home
drwxr-xr-x    4 root     root         296 Apr 22 13:08 .
drwxr-xr-x    1 root     root         544 Apr 22 08:53 ..
drwxr-xr-x    3 engineer engineer     224 Apr 22 13:27 engineer
root@Openwrt:/# ls -lha /home/engineer/.ssh
drwxr-xr-x    2 root     root         160 Apr 22 13:27 .
drwxr-xr-x    3 engineer engineer     224 Apr 22 13:27 ..
root@Openwrt:/#