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 09-15-2003, 04:41 AM   #1
smuh
LQ Newbie
 
Registered: Sep 2003
Posts: 4

Rep: Reputation: 0
chown - samba question


Hi!
I am currently setting up samba as a pdc. samba is running fine but now i would like to add file/directory permissions for groups and users...
i found a guide that said:
mkdir -m 0775 /home/netlogon

- means a directory netlogon in /home/ is created with:
rwx for root
rwx for group
r-x for everyone
right? but what does the 0 in front of 775 mean?

and what does:
chown 1757 /home/samba/profiles mean?
ok, i know it changes the owner.. but 1757??
757 =
rwx for root
r-x for group
rwx for everyone
right?
but the 1 in front of 757? i dont know which effect it has or what it means...

can somebody explain it to me? i couldnt find a guide/howto/or anything that could answer my question
 
Old 09-15-2003, 05:20 AM   #2
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Rep: Reputation: 30
Hello,

0775 is the same as 775 set on a file or folder.

The first digit in front of the normal 3 digits in a file permission is to set the user id, group id, and stick bit on files / folders.

If you add a 4, 2, or 1 in front of the normal 3 digits...

4 = user id
2 = group id
1 = sticky bit

Hope this helps : )

>Craig
 
Old 09-15-2003, 05:27 AM   #3
smuh
LQ Newbie
 
Registered: Sep 2003
Posts: 4

Original Poster
Rep: Reputation: 0
mmh, ok

if i create a directory /home/testdir

first i create it with mkdir -m 4777 /home/testdir

second i create it with mkdir -m 2777 /home/testdir

the third time i create it with mkdir -m 1777 /home/testdir

wheres the difference? what effect does it have on file/direcory permissions?
 
Old 09-15-2003, 07:42 AM   #4
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Rep: Reputation: 30
ok,

4 = set user id, this means that when you execute the file set with this, you are running it as the file owner. so if you wanted your normal users to be able to run a certain prog as super user, you would set this.

2 = group user id, pretty much the same as above but run the executable as the set group instead of the set owner.

1 = sticky bit, if you set this on the directory, the user will be able to write to the directory, but only rename, change, delete the files that he/she uploaded. If you look at your /tmp folder it has the stickly bit set ls -ld /tmp


I just did a quick google and found this site if you wanna read it, it might explain a bit better if i didn't.

http://www.linuxpowered.com/html/editorials/file.html

>Craig
 
Old 09-15-2003, 07:59 AM   #5
smuh
LQ Newbie
 
Registered: Sep 2003
Posts: 4

Original Poster
Rep: Reputation: 0
aaah thx a lot!

im new to linux but very interested in setting up a samba server with all permissions and whatsoever but couldnt really get into it.
im used to novell - thats what we still use at work. at home we used a windows 2k server for testing purposes but i kinda missing those old command line based oss
and well, linux is somewhat cheaper then windows :P
 
Old 09-15-2003, 08:05 AM   #6
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Rep: Reputation: 30
heheh yeah you're right there. i prefer command line stuff too. i use red hat at work and home. i prefer it. : )

good luck with linux in the future.

talk to you later.

>Craig
 
  


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
chown question marsguy Linux - General 2 09-29-2005 12:48 PM
samba smb.config question (quick question) TheDOGG Linux - Networking 1 03-02-2004 08:19 AM
chown -R ujotne Programming 3 02-25-2004 01:02 PM
chown Sathe Linux - General 13 10-14-2002 12:25 PM
RE: Samba question pls help {Newbie question} Radiouk Linux - Networking 4 06-03-2002 07:40 PM


All times are GMT -5. The time now is 04:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration