After creating a new user, can't access home folder

Hi,

I've just finished setting up my new Linode (apache/php/mysql etc).

Now I'd like to take steps to improve security, and from what I've read, disabling ssh for the root account & creating another user account is a good idea.

I'm able to create the new user with this command -

> adduser –home /home/user1 --shell /bin/bash

However after ssh'ing with the new user, I can't access the home folder. Does the home folder require further permissions setup, or have I missed an option when creating the user?

The error message I get after ssh login is -

> Could not chdir to home directory /home/aobyrne: Permission denied

-bash: /home/aobyrne/.bash_profile: Permission denied

The 'home' folder appears to be owned by user '501' with group 'staff', which seems to be different to all the other folders which with user & group as 'root'.

Cheers,

Adam.

2 Replies

Did the $HOME folder you specified already exist before running adduser? If so it will not update the permissions.

Regardless just chown -R the $HOME to the UID & Group of the user you created and you should be fine.

Troy.

Sorry if I've misunderstood, but as root run:

adduser aobyrne

Would create your user with access to /home/aobyrne

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct