LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2003, 12:51 PM   #1
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
simple permissions question


hi, quick question: how do allow a specific user full permissions over a specific folder, subfolders, and files within? (read/write/exec/delete/etc). I've read a bunch of man pages and I'm more confused now than before, and I don't want to mess things without asking first
 
Old 10-10-2003, 01:04 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Try:
chown -R /path/to/directory
chmod -R o+rwx /path/to/directory
 
Old 10-10-2003, 01:06 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
You can assign ownership with the chown command:

chown -R user /directory-or-file

And then set the correct permissions on the directory or file:

chmod -R 755 /directory-or-file

More info in the man pages:

man chown
man chmod

Some other helpful or alternatives to use:

man chgrp
man passwd
 
Old 10-10-2003, 01:12 PM   #4
zer0python
Member
 
Registered: Sep 2003
Posts: 104

Rep: Reputation: 20
Quick tutorial here on chmod:

1 = Execute
2 = Write
4 = Read

1+2 = 3 (Execute+Write permissions)
1+4 = 5 (Execute+Read permissions)
2+4 = 6 (Write+Read permissions)
1+2+3 = 7 (Execute+Write+Read Permissions)

here is a little more in depth thingy-majiggy:
chmod owner|group|other <folder||file>
so, if you wanted lets say only the group, and the owner to be able to do Execute+Write+Read, and no one else you'd use:

chmod 770 <folder||file>

hope that helps..

(btw, if the directory you want to give access to the user isn't already the owner or atleast part of that group, use chown, or chgrp)

ie:

chgrp users <folder>
cown 770 <folder>

again, hope that helps
 
Old 10-10-2003, 01:15 PM   #5
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Permissions can be modified using chmod (options) filename
just an example...
' ls -l junk4 '
-rwxr-xr-x 1 foo bar 6514 Aug 1 10:34 junk4
the first set refers to user, second to group, third to other
so
user = rwx
group = r-x
other = r-x

I personally use numbers to change permissions but you can use the letters if the numbers don't make sense...
what the numbers mean:
0 = no permission
1 = execute
2 = write
4 = read
You can add the numbers to change the permissions to what you want.
so 1+4=5 = r-x
2+4=6 = rw-
1+2+4=7 = rwx

So if I want a file to have rwxrw-r-- permissions I would do chmod 764 filename

You can also change using letters
u=user
g=group
o=other
a=all
then use + - or = to what you want
so chmod a-x will remove execute permissions for all users
chmod u+rwx will add rwx to the user

check out the man page 'man chmod' it explains other options and flags you can use...
edit:
Maybe I need to type faster or something... Best advice is make a file and mess with permissions until you are comfortable...

Last edited by Blinker_Fluid; 10-10-2003 at 01:17 PM.
 
Old 10-13-2003, 11:02 AM   #6
coupace
LQ Newbie
 
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
ownership?

ok, well, this is a stupid question i'm sure, but is there a way for me to tell linux that i'm the owner?
i'm trying to install the java sdk, and as per some instructions on this help page (step 3)

http://www.goland.org/Tech/Installin...drake_9_1.html

i need to alter the .bashrc but i can't make changes to it

it says i do not have permissions to change the permissions, so, i need to "become" the owner so to speak. and considering this is my computer, i think i should be allowed that property

any help on solving my own lack of knowedge?
thanks muchly

me = very -->

Last edited by coupace; 10-13-2003 at 11:03 AM.
 
Old 10-13-2003, 11:07 AM   #7
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
The .bashrc file is the one in your home directory, yes? If you can't change it as yourself, try using su (or su -) to become root and then change the permissions as per the above instructions.
 
Old 10-13-2003, 11:42 AM   #8
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
You probably ought to get familiar with the chown command. It allows you to change ownership on files like .bashrc.
example: chown username .bashrc
 
Old 10-13-2003, 09:36 PM   #9
coupace
LQ Newbie
 
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
hmmm... still didn't work

it still didn't work
i tried using chown as both root and as myself, and it didn't give me an error msg or anything, but i still can't save changes to .bashrc

ne other ideas?
thanks
coupace
 
Old 10-14-2003, 12:24 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Do you have write permission to the file?
ls -l /path/to/.bashrc
 
Old 10-15-2003, 11:29 PM   #11
coupace
LQ Newbie
 
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
ok, i'm not sure what i did, i logged in as root and changed some permissions that it wudn't change b4 (even as su) and then went back to my user and then it let me save it soo, all's well that ends well thanks for ur help ppl!
coupace
 
Old 10-16-2003, 03:07 AM   #12
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Su doesn't seem to have all of the permissions. I believe that if you use 'su -' then you get full permissions. Glad to hear it worked, though.
 
Old 10-16-2003, 01:47 PM   #13
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Quote:
Originally posted by XavierP
Su doesn't seem to have all of the permissions. I believe that if you use 'su -' then you get full permissions. Glad to hear it worked, though.
The permissions should still be the same. Running "su -" starts a new shell for the user you are suing to - this is useful for loading extra paths such as /sbin automatically.
 
Old 10-16-2003, 02:47 PM   #14
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Thanks david_ross, I was repeating something I read against a different question. I didn't think it was fully correct, but as no one corrected the person I took it as read.
 
  


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
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 02:03 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
simple questions about permissions chrismiceli Linux - General 6 06-15-2003 12:00 PM
Is there a simple way to give all permissions frontier1 Linux - General 3 02-28-2003 08:55 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM


All times are GMT -5. The time now is 03:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration