LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 04-12-2012, 10:12 PM   #1
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Rep: Reputation: 15
Setting a directory permission


i think I got samba working on my Ubuntu server 11.4
My windows pc see the share directory but I think I need to change the dir permission.
what cli do I use to make the dir
/home/storage able to let anybody write and read to it.



Robert
 
Old 04-12-2012, 11:35 PM   #2
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 439

Rep: Reputation: Disabled
mkdir to make the directory

chmod to modify it's permissions but if you want the people using Windows shares to read/write to it you would need to modify the share on samba's end by editing /etc/smb.conf. Very helpful guides can be found on http://www.samba.org/ for that.
 
Old 04-13-2012, 06:06 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 394

Rep: Reputation: 15
edit the file smb.conf and put the permission and access level of share file/folder ..
 
Old 04-13-2012, 02:03 PM   #4
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Original Poster
Rep: Reputation: 15
I added the following lines to the smb.conf at the end
[storage]
Comment = storage
Writable = yes
Path = /home/storage

After adding this and resetting the smb service all windows systems would see the available storage dir in the network neighborhood but when I try to ve a file to it from said systems I would get a warning that I had not te permission what do I need to do now.

I used the command
sudo midair /home/storage
To treate the dir on the system
 
Old 04-13-2012, 02:29 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
The directoty should be rwx for all with the sticky bit set.

#> sudo chmod a=rwxt /home/storage/
 
Old 04-13-2012, 05:18 PM   #6
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Original Poster
Rep: Reputation: 15
It works I am able to access it from ny pc in my home. For now it will do I am not worried abou dir privacy as I am placing it in a small school and only for teachers to story school related fles on it.
 
Old 04-13-2012, 06:04 PM   #7
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,413

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
hewittrj,

I think, if you would have given 744 permission to /home/storage directory, that would have also worked for you.
 
Old 04-13-2012, 09:35 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
The permissions of the directory being shared will not allow "anybody" to save files in it with 0755 permissions.
If you want users who are teachers to be able to access it, create users for them on the samba server:
sudo smbpasswd -a <username>

Create a 'teachers' group. Change the group ownership of the directory to teachers'.
Change the permissions to ug=rwx,o=rxt
Now users who aren't owners, and not members of the `teachers' group will have read access but not write access.

It the permissions of a directory are stricter than the samba permissions, you will have the lesser permissions.

The samba.org website has a good book: Samba 3 by Example. It will walk you, step by step, through setting up different types of samba shares, including creating the directories, setting permissions, and configuring smb.conf.
 
Old 04-14-2012, 02:55 PM   #9
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Original Poster
Rep: Reputation: 15
Right now creating users is not a priority ESP as the teachers may different by the time I get the system in place
 
  


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
DISCUSSION: Setting File and Directory Permission in Unix/Linux munawer_hassan LinuxAnswers Discussion 1 03-23-2010 12:40 PM
Setting permission for multiple users to a directory sen Linux - Newbie 16 02-26-2010 05:03 AM
setting permission SVwander Linux - Newbie 9 01-28-2007 12:04 PM
Setting File permission to Mounted Directory nebumt Linux - General 3 01-12-2006 01:11 AM
Setting File / Directory Permission, with sticky Primetime Linux - Newbie 3 01-06-2003 02:14 PM


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