Diet pi newuser in rasp.B+ 1.2

Hi Guys , i create a non root user with password with linux command by useradd etc… but when i try to connect by ssh return me this error
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Connection to 192.168.0.11 closed.
, why ? ?

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=13
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘applied’
    G_LIVE_PATCH_STATUS[1]=‘not applicable’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    echo $G_DISTRO_NAME $G_RASPBIAN

  • Kernel version | uname -a
    Linux DietPi 5.15.84+ #1613 Thu Jan 5 11:58:09 GMT 2023 armv6l GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi B+ (armv6l)

  • Power supply used | (EG: 5V 1A RAVpower)
    5v 1.5 A

  • SD card used | (EG: SanDisk ultra)

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Expected behaviour

Actual behaviour

Extra details

Can you tell how you used the useradd command?
E.g.
useradd -m -s /bin/bash arthur.dent
And then set the password via
passwd arthur.dent

thanks for rply i add in this mode

sudo useradd  MYUSERNAME
sudo passwd MYUSERNAME
and  after, when it ask me a password ,.... i gave  the password 
thanks bye

Let’s check
grep MYUSERNAME /etc/passwd

stefano:x:1001:1002::/home/stefano:/bin/sh

can you login as user root and try to switch manually?

su - stefano

Maybe switching to bash helps:
usermod --shell /bin/bash stefano

1 Like

i try it now change my promt to root@dietpi in $ but if i run ls return ls: cannot open directory ‘.’: Permission denied

afeter this usermod --shell /bin/bash stefano if i do su stefano return stefano@DietPi:/root$

but if i try to connect by ssh directly return

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Connection to 192.168.0.11 closed.

You can check the usermod again via
grep MYUSERNAME /etc/passwd

i try in stefano shell instal bta-lib by pip and return me this

pip install bta-lib
WARNING: The directory ‘/home/stefano/.cache/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo’s -H flag.
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: Simple index, piwheels - Simple index
Requirement already satisfied: bta-lib in /usr/local/lib/python3.9/dist-packages (1.0.0)
Requirement already satisfied: pandas in /usr/local/lib/python3.9/dist-packages (from bta-lib) (1.5.3)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas->bta-lib) (2022.7.1)
Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.9/dist-packages (from pandas->bta-lib) (2.8.2)
Requirement already satisfied: numpy>=1.20.3 in /usr/local/lib/python3.9/dist-packages (from pandas->bta-lib) (1.24.1)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil>=2.8.1->pandas->bta-lib) (1.16.0)
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: ‘/home/stefano’
Check the permissions.

i think not have permetion ?

stefano:x:1001:1002::/home/stefano:/bin/bash

Possibly the ownership of /home/stefano is the problem?
You could try
chown -R stefano:users /home/stefano

At least, the changeober to bash worked.

chown -R stefano:users /home/stefano
chown: cannot access ‘/home/stefano’: No such file or directory

in home i have only dietpi why ? o_O

So, the reason is, that adduser did not generate your home dir.
This could have been done with the -m option of adduser.
So now
mkdir /home/stefano
Then chown like above and try to login.

Originally, you needed
useradd -m -s /bin/bash stefano

ooo why if i want add user ofcourse i want also home folder no ??
thannks now go with ssh in shel terminal
but why if i want connect a fodler in mate not go ? i click file —> connect to server —> choice ssh port 22and insert user and password but tell me connection faild