LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-23-2011, 10:04 PM   #1
alessio
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Rep: Reputation: Disabled
Need Help with File Permission, please.


Guys, I am sure this question has been answered a million times, but I cannot for the life of me find a simple answer (I am sure I am to blame )

I got tired of Windows and isntalled Ubuntu. I love it.

I have one problem.

I have only one user, it is called "a" (literally).

I have a home/a/music forder with all my music.

For some reason, root is the only one who has access to some of the files and folders.

Me being a windows guy, I googled around and found the command "gksudo "gnome-open /". I run it and it gives me an error, but it runs a file manager all the same, with root credentials. I know, I know, this is the best way to freak linux guys out. I only have music in this PC, no sercurity risk. Shall Anonymous decide to hack it, I'll just reinstall ubuntu

So, I have the file manager running with root credentials, I select my "music" forlder, select "a" in permisions and choose "a" in all pull downs and create and delete files whenever possible. Apply to all sub folders and files (or something like that). Then I go into the folders and the folders and files's permisions have not been changed.

So I went into some folders and changed it, but the files inside did not change.

Now I have a nightmare of "root", "a", group "a", group "root" (and all that) all over my music and I cannot copy, move or listen to my tunes.

Is there a way to tell linux that "a" AND "root" are to be allowed to do what ever they please with every single file and folder in my musci folder?

If so, please, please, please, put something I can copy and paste in a terminal window, as I am not linux sabby, and things like "run pkNuke on the /rtr main sub-console" means nothing to me but that I have a lot of catching up to do

Cheers,

Alessio
 
Old 08-23-2011, 10:19 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
The two commands you want are chown and chmod.

Open a terminal in root.

In your case I guess you could run the following command.

Code:
gksudo gnome-terminal
First you need to take ownership of the files.

Code:
chown -R a:a /home/a
That takes ownership of /home/a folders, subfolders, and files and makes user a (with group a) ownership of the path.

Then you could modify the permissions of your folders.

Code:
find /home/a -type d -print0 | xargs -0 chmod 750
That will give read/write/execute to the owner of all the folders under the path /home/a, read/execute to all groups members (users part of group a), and give no permissions to everyone else.

You could leave the file permissions alone for now and see if modifying the permissions to just the folders resolves your problem.

That's how I would recommend recovering from this dilemma as a start.

SAM

Last edited by sag47; 08-23-2011 at 10:22 PM.
 
1 members found this post helpful.
Old 08-23-2011, 10:55 PM   #3
alessio
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sag47 View Post
The two commands you want are chown and chmod.

Open a terminal in root.

In your case I guess you could run the following command.

Code:
gksudo gnome-terminal
First you need to take ownership of the files.

Code:
chown -R a:a /home/a
That takes ownership of /home/a folders, subfolders, and files and makes user a (with group a) ownership of the path.

Then you could modify the permissions of your folders.

Code:
find /home/a -type d -print0 | xargs -0 chmod 750
That will give read/write/execute to the owner of all the folders under the path /home/a, read/execute to all groups members (users part of group a), and give no permissions to everyone else.

You could leave the file permissions alone for now and see if modifying the permissions to just the folders resolves your problem.

That's how I would recommend recovering from this dilemma as a start.

SAM


Did you ever know that you're my hero,
and everything I would like to be?
I can fly higher than an eagle,
'cause you are the wind beneath my wings.

It might have appeared to go unnoticed,
but I've got it all here in my heart.
I want you to know I know the truth, of course I know it.
I would be nothing without you.

Oh, the wind beneath my wings.
You, you, you, you are the wind beneath my wings.
Fly, fly, fly away. You let me fly so high.
Oh, you, you, you, the wind beneath my wings.
Oh, you, you, you, the wind beneath my wings.
 
Old 08-23-2011, 11:21 PM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Glad I could help. Here is a great tutorial which teaches you how the chmod command works interactively. I used it the first time I learned chmod.

http://catcode.com/teachmod/

You could also look up Linux ACL (or Access Control List) as this is basically what we changed to fix your problem. If you have a security concern with ACLs then I have previously answered a question on this so it's not a bad read.

Don't forget the man pages for a command (which is like running COMMAND /? in Windows). Type "man man" without quotes in the terminal and you'll see what I mean.

Code:
man chmod
man chown
Press q to quit the man page entry.

Last edited by sag47; 08-23-2011 at 11:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 09:57 AM
File Permission - Read an execute only file e_x_p Linux - Security 1 12-16-2009 07:08 AM
regarding file permission for db2 backup image file lx4all Linux - General 1 12-13-2007 03:37 PM
Changing file permission, How to edit a file? rainchild Linux - Newbie 8 01-14-2007 10:18 PM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration