Let's say I have a user called panos and he has his home directory located at
/home/panos. Then, I create a another user called Tom:
It creates a user Tom who has home dir:
The question is: what if I would like to create a new user and give him as home dir the home dir of another user. For example, let's create the user Jerry and pass him as his home dir the home dir of user Panos:
adduser -d /home/panos Jerry
but there's an error saying:
adduser: warning: the home directory already exists. Not copying any file from skel directory into it.
However, if you take a look at the
tail -n 3 /etc/passwd anthony:x:501:501::/home/anthony:/bin/bash panos:x:502:502::/home/panos:/bin/bash Jerry:x:503:503::/home/panos:/bin/bash
it seems it worked. But when I tried to log in as Jerry:
[root@LinuxAcademy ~]# su Jerry bash-4.1$ bash: /home/panos/.bashrc: Permission denied bash-4.1$
it prevents me from loggin in as Jerry and it also changes my prompt (the PS1).
So, how can I do this? Is it possible?