Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

It seems to me that I have the proper permissions, so why can't I create directories in my $HOME directory?

dotancohen@neptune:~$ whoami
dotancohen
dotancohen@neptune:~$ pwd
/home/dotancohen
dotancohen@neptune:~$ ls -l .. | grep dotancohen
drwxr-xr-x 16 shelly shelly  4096 Jul  2 15:02 dotancohen
dotancohen@neptune:~$ mkdir test
mkdir: cannot create directory `test': Permission denied
dotancohen@neptune:~$
share|improve this question
6  
Who is shelly? –  Takkat Jul 5 '12 at 7:30
    
Are you the only user of your PC. –  tijybba Jul 5 '12 at 7:49
    
Shelly is another user of the computer, the user from which I sudo useradd -m dotancohen. I cannot believe that I did not notice that she owns my home! –  dotancohen Jul 5 '12 at 12:23
add comment

2 Answers

up vote 5 down vote accepted

Somehow your home directory is owned by user shelly. If you have sudo privileges, you can change it back:

sudo chown -R dotancohen:dotancohen /home/dotancohen
share|improve this answer
4  
We also need to find out why shelly owns dotancohen's HOME - this did not happen by accident ;) –  Takkat Jul 5 '12 at 7:40
1  
Note: the -R in that command will change ownership of all files within your home directory, too. Normally, that is exactly what you want since you want the files in your home directory to belong to you. But just in case for some reason it isn't, it's probably worth pointing this out. –  neon_overload Jul 5 '12 at 7:42
    
@Takkat if I had to guess, it may be that the OP wanted to change the name of her (or his?) user account, but instead of renaming it, created a new one and renamed the home folder to move everything over. Which while not being all that harmful, is not necessarily the easiest way to do it. –  neon_overload Jul 5 '12 at 7:45
    
Sure. One possibility is that OP reinstalled the system recently keeping /home intact (on a separate partition) - in this case users in the new system might have got different user IDs. If this is not the case then I'd ask Shelly why the permissions have changed... If the OP does not know who Shelly is then yeah, this is a problem. –  Sergey Jul 5 '12 at 7:47
1  
Thank you, shelly was the user from which I created dotancohen. I cannot believe that I looked at the permissions but not at the owner/group! –  dotancohen Jul 5 '12 at 12:24
add comment

Well obviously you don't own your own home directory but shelly does. You may only execute (or read execute; if you are in the same group as shelly is). Therefore you cannot create a directory. Sudo can though; so sudo mkdir test should work. You might want to reown this directory for your user dotancohen as superuser. See mapage chown for that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.