LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 12-11-2005, 01:58 PM   #1
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Rep: Reputation: 15
Having problems changing permissions on a folder


I've mounted an MP3 player on a folder:

billy: current user

$home/billy/flash

and I cannot access it through KDE, I can only do it from the console and only when I log in as root. I have tried

#chmod -Rv u-w,u-x /home/billy/flash

#chown -Rv billy /home/billy/flash

and

#chgrp -Rv billy /home/billy/flash

All of them failed. I even tried to change permissions from Mandrake Control center but it also failed. What am I supposed to do????
 
Old 12-11-2005, 02:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
only unix filesystems can be subjected to changes in unix file permissions (where do you suppose the information would go? instaead permissions and ownerships of non-unix filesystems need to be hard set at mount time, e.g. "mount /dev/blah /mnt/blah -o uid=500,umask=022" says user 500 owns all the files with a mask of 022, i.e. rwxr-xr-x
 
Old 12-12-2005, 01:56 AM   #3
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
I have to give the parameters in octal? 'Cause I don't want anyone to have write/execute permission (-o,<others>) to the disk, only the user billy. How do I do that?
 
Old 12-12-2005, 03:03 AM   #4
bassem_16
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
chmod 754 "folder Name"

this means that the user will have all privileges , group --> read , and execute , othrer --> read

"chmod -Rv u-w,u-x " what's the -Rv ??

+ you're takin off the write and execute permission for this folder this way ..

am i missing something here ?
 
Old 12-12-2005, 03:13 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
as i said, you can't chmod / chown non-unix compliant file systems. set the mask on mount. it's a pretty trivial difference between an octal code an a character string...
 
Old 12-12-2005, 08:58 AM   #6
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
What bassem says is correct, but i can't determine this way which user will have the priviledges(I can only type chmod when I log in as root). I can give an -o, but everyone will have access. It is non-unix compatible, I gave this order to the windows partition and it worked. But how do I give priviledges to a specific user?
-Rv is recursevily and verbose mode(it show all files affected by the order)
 
Old 12-12-2005, 10:52 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
if you want files to be owned by a different user or group use a uid= or gid= option
 
Old 12-12-2005, 11:37 AM   #8
bassem_16
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
while you're logged in $home/billy/ type "ls -al" , this way you'll know every file and folder permission and the owner of it, the root and owner can only change mode
 
Old 12-13-2005, 08:24 AM   #9
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
acid kewpie said
Quote:
if you want files to be owned by a different user or group use a uid= or gid= option
..and how do I do that? What is the syntax of this command?
 
Old 12-13-2005, 01:42 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
please see the manpage for "mount" for all these syntax queries. that's what it's there for.
 
Old 12-16-2005, 02:57 AM   #11
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
OK with the MP3 player(and other USB keys), but I still can't find out how to change permissions on a folder for a specific user. The command chmod isn't helping me 'cause the arguments are incomplete(it has u, but it won't let me specify which user will be the u). And I can't use the command for the current user, 'cause the system is letting me to use the command only when I log in as root. What am I supposed to do?
 
Old 12-16-2005, 03:45 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
the user owner is defined by the chown command.
 
Old 12-18-2005, 05:18 PM   #13
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
It seems that I didn't know how to change the permissions in the MP3 player after all. I've changed the owner from root to a normal user(through chown and chgrp) but whenever I mount it(sth that I still do from root), and open the folder I mounted it with Konqueror, I don't see my files. I saw in the man pages that this has something to do with the file /etc/fstab, but I got confused. What I want to do is whenever I mount this device(or any USB key), to be fully accessible by a specific user(read, write and execute commands).
Any ideas?

Offtopic: Hey, mr admin, why aren't any avatar options in the profile?

Last edited by zener; 12-18-2005 at 05:23 PM.
 
Old 12-19-2005, 03:01 AM   #14
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
how many times am i going to have to tell you that YOU CAN NOT USE CHMOD / CHOWN ON A NON-UNIX FILESYSTEM? use the umask / uid / gid options in /etc/fstab.

and avatars are disabled, because they are for children and bored housewifes talking about babies.
 
Old 12-19-2005, 05:04 AM   #15
zener
Member
 
Registered: Jul 2005
Location: Greece
Distribution: Mandrake 10.1 , Ubuntu 5.1
Posts: 59

Original Poster
Rep: Reputation: 15
Eeeeh... any links for that?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 05:23 PM
folder permissions steve007 Linux - Newbie 1 06-30-2005 12:46 PM
Changing permissions of mounted folder of XP box owain Linux - Networking 1 06-12-2004 04:09 PM
Folder permissions help Seventh Linux - Newbie 2 04-22-2004 05:56 PM
Problems changing permissions of mount point DustOffTryAgain Linux - Software 14 09-04-2003 09:18 PM


All times are GMT -5. The time now is 10:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration