useradd does not create a home directory

Peace,

cat /etc/passwd
privelegedrooter:x:1033:100::/home/priveledgedrooter:/bin/bash
sudo usermod -d /home/priveledgedrooter priveledgedrooter

usermod: no changes


When logging in

Using username “priveledgedrooter”.
Have a lot of fun…
Could not chdir to home directory /home/priveledgedrooter: No such file or directory



is the only right way to create a user is to do it through yast?

From their man page heads:

usermod - modify a user account

useradd - create a new user or update default new user information

It is explained better than I could (I do not understand what you want, sorry):
https://wiki.archlinux.org/index.php/users_and_groups

I see nowhere in your post that you created the user through useradd, let alone which options/parameters you used.

I see nowhere in your post that /home/priveledgedrooter realy does not exist, e.g. by

ls -l /home/priveledgedrooter

The only thing I see is that you try to change the home directory to the same one, which apparently usermod seeing this and not doing anything, let alone creating it anew.

I assume most people use the YaST module for this, but useradd should work also of course.

Your thread title mentions usreadd, but all of your examples use usermod.

With useradd, at least, you must add the -m option to have it no only
specify, but also create, the home directory. This may be what you wanted
all along, but now that you have the user just create the directory and
remember next time to create properly with “useradd -m username”:


mkdir /home/priveledgedrooter
chmod 700 /home/priveledgedrooter

Note that the chmod above is my personal preference, and not the normal
SUSE thing to do.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

I forgot the other obvious command:


chown privelegedrooter: /home/privelegedrooter


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

On Thu 24 May 2018 12:00:21 PM CDT, ab wrote:

I forgot the other obvious command:

chown privelegedrooter: /home/privelegedrooter

Hi
For user add use the -m option to create the home directory eg;


useradd -m privelegedrooter

With usermod it’s the -d or -m option for new directory or move
contents as well…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 RC4 | GNOME Shell 3.26.2 | 4.12.14-18-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!