Thursday, January 7, 2016

Permission on hard drive ubuntu

I had a hard drive I moved from one computer to another. It turned out that by switching computers I couldn't access the files on my hard drive since I didn't have the right permissions on the new computer. So what I ended up doing was to create a new group and change the group on the files on the hard drive recursively and then add my user name to the group just created. Anyhow, it seemed to work pretty good. This was taken from this post http://superuser.com/questions/280994/give-write-permissions-to-multiple-users-on-a-folder-in-ubuntu

sudo groupadd tomandruser
Now that the group exists, add the two users to it:
sudo usermod -a -G tomandruser tomcat6
sudo usermod -a -G tomandruser ruser
Now all that's left is to set the permissions on the directory:
sudo chgrp -R tomandruser /path/to/the/directory
sudo chmod -R 770 /path/to/the/directory

No comments: