2

I changed my harddrive from I3 to I5 machine. Originally

  • I3 machine had Ubuntu 14.04 harddisk with user dell
  • I5 machine had Windows 10 harddisck originally with user masi

Now

  • I5 machine with Ubuntu 14.04 harddisk

and I get permission denied messages, even in trying to create a folder to my desktop of Ubuntu 14.04 LTS:

Error while creating directory Untitled Folder. There was an errer creating the directory in /home/dell/Desktop. Show more details > Error creating directory: Permission denied.

Also I needed to do after the harddisk change

  • reactivate Matlab in the system once again.

I think I have privilege/permission/owner problem in my whole system.

After Alex's command

I actually run Alex's command sudo chmod -R 755 /home/dell/ but not seeing anything strange. Which files of 644 and 664 could be messed up by the command?

Outputs of Ralph's commands

The command echo $USER gives dell. The command ls -l /home/ gives

drwxr-xr-x 29 dell dell 4096 joulu 14 00:35 dell

How can you fix the privilege problem in the system?

6
  • Try chmod -R 755 /home/dell/ run that as root by doing sudo -i
    – Alex Lowe
    Dec 13, 2015 at 20:46
  • 3
    @Alex why would you do that and not 1st ask about the user/group permissions of that disk? It is inside a users home... so permissions for user/group should be set to that user otherwise it will complain about permissions. And if they are set to that user ... there should be no problem with permissions. What your command does is potentially mess up permissions to files that need to be 644 or 664.
    – Rinzwind
    Dec 13, 2015 at 20:51
  • 1
    @masi please explain in more detail what you did. You moved a disk from one system to another. What was on it and what was not? I asssume it held a /home? But was it a complete system with / or was it a partition only holding /home? If the latter: do the 2 systems have different usernames?
    – Rinzwind
    Dec 13, 2015 at 20:53
  • 3
    @Rinzwind He is probably getting that error because he is moving it from one machine to another with different users on either of those machines.
    – Alex Lowe
    Dec 13, 2015 at 20:56
  • 1
    Please go to a terminal and use these two commands, then edit the question with its output: 1) echo $USER 2) ls -l /home/. Dec 13, 2015 at 21:39

1 Answer 1

1

Running these commands will change the owner of the directories owned by dell in /home/dell to masi and the group of the directories in the dell group in /home/dell to masi:

find /home/dell -type d -user dell -exec sudo chown masi {} +
find /home/dell -type d -group dell -exec sudo chown :masi {} +

The first one will change the owner, the second one will change the group.

You may also wish to change the owner / group of the files; if that's the case run the command without the type -d switch:

find /home/dell -user dell -exec sudo chown masi {} +
find /home/dell -group dell -exec sudo chown :masi {} +
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .