New answers tagged

0

drwxrwx--- 2 ftpuser myuser 4096 Jul 12 16:47 ftpuser uid=502(myuser) gid=503(www-data) groups=503(www-data),505(ftpuser) the group on the dir is myuser, and myuser does not have group myuser, but it has ftpuser. Fix with either: usermod -a -G myuser myuser or (preferred so files created by ftpuser also have the same group as you): chgrp ...


1

Run blkid to find out the UUID of the relevant partition, then edit /etc/fstab accordingly: UUID=... /home ext4 nosuid,nodev,noatime 1 2


1

Command usermod fails if the said user has process(es) running under the same username, regardless what you are trying to modify in this account. You either have to kill all processes owned by this user (in a corporate environment, I need to warn you , NOT to do that) or just edit the /etc/passwd file and change whatever you need and the next time the user ...


2

sudo doesn't necessarily update the HOME variable for the new user. If you want HOME updated, use the -H or -i options. For example: sudo -Hu newuser bash Alternatively, you can add this line to the /etc/sudoers file to have sudo automatically update HOME and other relevant variables: Defaults env_reset Many distributions already have ...


3

The manual page for userdel describes the -r option, which would remove the home-directory at the time you removed the user. If you did not do it then, you could find files with no known user with the find option -nouser, e.g., find /home -nouser -delete though you might want to verify the list before actually deleting the files: find /home -nouser -ls ...



Top 50 recent answers are included