System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

permission problem in home directory when creating users with useradd

SOLVED
Go to solution
senthil_kumar_1
Super Advisor

permission problem in home directory when creating users with useradd

Hi

I am using RHEL4. I used "useradd" command to create a user.

# useradd john
or
# useradd -m john

# cd /home

# ll -d john

d--------- 2 john john 96 Mar 23 09:16 john

so there is no permission (rwx) set in this directory.

I am getting following error. If i try to change the permission thru "root" user.

# chmod 755 -R john
chmod: changing permissions of `john': Operation not permitted
chmod: `john': Permission denied


All the users home directories are created in same way.

So pls help to solve this problem.

4 REPLIES
Gokul Chandola
Trusted Contributor

Re: permission problem in home directory when creating users with useradd

Hi,
There is some other issue with security.
By default there should be some default rights to User (newly created).

There is issue with security policy applied with your system.

First you have to check security policy.

There may be some other issue with new user add is linked with other policy.

Regards,
Gokul Chandola
There is always some scope for improvment.
V. Nyga
Honored Contributor

Re: permission problem in home directory when creating users with useradd

Hi,

maybe you should do it as 'root' or 'administrator'.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Autocross.US
Trusted Contributor
Solution

Re: permission problem in home directory when creating users with useradd

Please post the output of these commands:

- umask
- ls -ldZ /home

I suspect the selinux context of /home may be incorrect. It should be:

system_u:object_r:home_root_t
I drive way too fast to worry about calories.
Jeroen Peereboom
Honored Contributor

Re: permission problem in home directory when creating users with useradd

L.S.

what is the result of (all executed by root):
- ls -ld /home
- cd /home; mkdir newdir; ls -ld newdir
- umask
- which useradd (or type useradd)

JP