Seems to all run fine except the new user’s home dir created has owner of root:root instead of username:username
as in /home/username
I only noticed this because I was using vim to edit some scripts for new paths and was getting errors about temp files or writing files in the user dir.
I just created a new temporary user, and it also was created with root:root as owner for /home/temporary
I have older user accounts I created when I first set this server up, and they were as I would expect. i.e. thatuser:thatuser for ownership. Now they’re being created with root:root.
same bug different place? I can’t see a reason we’d want to create the user home dir with root ownership on purpose. This must be a bug.
It seems on purpose, as when I change from ssh access from nologin to choosing a shell, it changes the home dir ownership. And it goes back to root ownership when I change ssh back back to nologin.
I guess this is seen as some extra security? I’m not sure what the benefit would be. I ran into this because I went from root user to the user for a particular website to edit and test scripts as that user. I was getting vim errors with the temp file creation. I hope someone might be able to explain the benefit.
Ah. sftp jail. I wasn’t aware root had to own the user home dir for this. Thanks for explaining the why. Perhaps I can change permissions on the vim temp file to resolve that error when creating new files as the user instead of root.
Or I can create my files as root and later change their ownership to the user. You know, like a caveman!