Unable to log in (home folder permissions)

Asked by Kẏra

The technology department head at my school gave me a brand new iMac out of the box to dual-boot Ubuntu.

Okay so on this computer at school (a really nice one) i made two accounts, nnhs, and admin. The problem is, i made admin first, and i made the home folder /nnhs, then i made the nnhs account and realized it could log in because they shared a home folder. So i created a /admin home folder but i couldn't log in because it was empty.

From this point on i'm working from the LiveCD. I coped all of the contents of /nnhs to /admin but i have to make sure that /nnhs is owned by nnhs and that /admin is owned by admin. I also have to make sure that either user can't write to the opposite user's home folder. I also have to make sure the permissions are correct for both .dmrc files - can anyone help me sort this out?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ralph Janke
Solved:
Last query:
Last reply:
Revision history for this message
Best Ralph Janke (txwikinger) said :
#1

Thanks for the question.

In a commandline terminal you can use chown to change the owner of a file/directory and chmod for changing the permissions.

sudo chown -R nnhs /nnhs

will make all files and directories inside /nnhs and /nnhs itself owned by nnhs

sudo chmod 700 /nnhs

will give all permission to the folder to nnhs and none to any other account.

I hope this helps.

Revision history for this message
Cesare Tirabassi (norsetto) said :
#2

Are you familiar with command line interfaces?
If you can open a terminal, you could use the chown and chmod commands to change owners and permissions for all files in the /home/nnhs/ and /home/admin/ directories (use sudo if needed).

>i have to make sure that /nnhs is owned by nnhs and that /admin is owned by admin

You should then use the commands:

chown -R nnhs:nnhs /home/nhhs/
chown -R admin:admin /home/admin/

>I also have to make sure that either user can't write to the opposite user's home folder

You can do that disabling the write attributes for groups and users:

chmod -R 755 /home/nhhs/
chmod -R 755 /home/admin/

Revision history for this message
Kẏra (thekyriarchy) said :
#3

Thanks Ralph Janke, that solved my question.