Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-02-2012, 06:30 PM   #1
LQ Newbie
Registered: Aug 2011
Posts: 20

Rep: Reputation: Disabled
permission changes to match template homedir /etc/samba/smb.conf?

in my /etc/samba/smb.conf file, i have the template for the home directories like this:
template homedir = /home/%D/%U

now i need to change the permissions (in a script) that will change the permissions of those folders, to that user
that folder should be chown for that user. how do i do that?
Old 03-02-2012, 11:40 PM   #2
Registered: Jul 2009
Posts: 626

Rep: Reputation: 42
To my knowledge, I dont think you can put chown in the smb.conf, you can maybe try putting in the smb.conf valid users = @%U and then when mapping the share use umask=077
Old 03-03-2012, 12:28 AM   #3
LQ Newbie
Registered: Aug 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
its alright if i cant chown in the smb.conf file. i dont care if there is a stand alone command to do it. i wrote a script which creates a folder on a network drive (called homedirectories):
chmod 777 -R /net/homedirectories/home/DOMAIN

and for some reason i am not able to copy files while logged in as bsmith into the folder: /net/homedirectories/home/DOMAIN/bsmith
after bsmith logs in, his home folder is created. i am unable to copy stuff into that home folder unless i: chown bsmith /net/homedirectories/home/DOMAIN/bsmith

im looking to include this in the script unless you can think of an easier way to do it, even it opens up that home folder as far as privileges are concerned for everyone
Old 03-03-2012, 04:23 AM   #4
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
The starting point for such a script would be a list of users and home directories you want to change. You could get that by manually editing the output of awk -F: '{ print $1 " " $6 }' /etc/passwd


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
smb.log / smb.conf problem (printcap) on VU+DUO tuner using Samba xlarge Linux - Newbie 0 01-04-2011 06:10 AM
Unable to open configuration file "/etc/samba/smb.conf" Permission denied jijawm Linux - Enterprise 8 08-18-2010 12:47 PM
configure smb.conf for set permission file and folder b-RAM Linux - Server 11 04-16-2009 04:15 AM
Samba in Debian, smb.conf: smb passwd file = ?????????? henrnorl Linux - Software 1 10-06-2006 10:43 AM
smb.conf file write permission jbraum Mandriva 3 01-09-2004 06:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:58 PM.

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