Hello,
I have tried to create user and his home directory in an applicaton snap on ubuntucore:
Useradd –m –extrausers user1
At first only account-contro interface is connected. The home directory cannot be created because permission denied for creating a folder in /home.
Then I connect the system-files interface to grant the write permission to /home:
plugs:
config-home:
interface: system-files
write:
- /home
The user account with home directory /home/user1
were then created.
But I still got two problems:
-
The owner of /home/user1 is root. I tried to change the owner with
chown –R user1:user1 /home/user1
and then got error information:
chown: changing ownership of '/home/user1': Operation not permitted.
-
I always got error information after “useradd” command executed:
/sbin/pam_tally2: Permission denied
useradd: failed to reset the tallylog entry of user "user1"
Is it the right way, use the “system-file” interface for help to create home directory? If yes, what can I do to set the correct ownership of home directory.
How can I handle the error message? If I don’t lock the failed login, can I just ignore this error?
Thanks