How can I create a new user but with a home directory that already exists

You did create a user with a home directory that already exists.

adduser: warning: the home directory already exists.
Not copying any file from skel directory into it.

This isn’t an error, it’s a warning. Usually, the reason not to create a home directory is for a user whose home directory isn’t supposed to exist. Here, it does, which has a high chance of being an error by the system administrator (e.g. a bad copy-paste or a buggy script). Since you really meant to use an existing home directory, ignore this warning.

[root@LinuxAcademy ~]# su Jerry
bash-4.1$ bash: /home/panos/.bashrc: Permission denied

You did log in as Jerry. That bash 4.1 is running as Jerry. Jerry doesn’t have the permission to read his ~/.bashrc, either because the file .bashrc is only readable to panos (and perhaps to a group that Jerry doesn’t belong to), or because the directory /home/panos itself is not accessible (x permission) to Jerry. So bash tells you that it can’t read its startup file, and it displays its default prompt.

Having multiple users with the same home directory is very unusual (excluding system accounts whose home directory doesn’t matter). What you should do about permissions depends what you’re trying to achieve by this. You probably do want to at least allow all these users to read their home directory.

კომენტარის დატოვება

თქვენი ელფოსტის მისამართი გამოქვეყნებული არ იყო. აუცილებელი ველები მონიშნულია *

Previous Post

Mounting a NVME disk on AWS EC2

Next Post

Removing Data From ElasticSearch

Related Posts