you sir/madam are my personal hero.
you LITERALLY saved my job. thank you.
you sir/madam are my personal hero.
you LITERALLY saved my job. thank you.
Last edited by dmizer; July 30th, 2006 at 07:06 AM.
1) Samba server howto | 2) mount windows/samba shares with CIFS + unicode | 3) best FTP server howto
4) NFS server/client howto | 5) Easy cross-platform LAN file sharing with FTP
6) Fix samba browsing!!! | 7) Fix Pulse audio
Happy Ubunting!
and just ran into my first snag. can't figure out how to add multiple users.
it works for the primary user on the system, but if i add users via the following example:
i can't get the additional user to work.Code:sudo useradd -s /bin/true NEW_USERNAME sudo smbpasswd -L -a NEW_USERNAME sudo smbpasswd -L -e NEW_USERNAME
for this section of my samba.conf file:
where do i add the additional user?Code:[MyFiles] path = /media/samba/ browseable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 force user = YOUR_USERNAME force group = YOUR_USERGROUP
if i say "force user = YOUR_USERNAME NEW_USERNAME"
then no one can logon.
but if i configure it as follows:
where NEW_USERGROUP is the same as NEW_USERNAME.Code:force user = YOUR_USERNAME force group = YOUR_USERGROUP force user = NEW_USERNAME force group = NEW_USERGROUP
then i can log on with the YOUR_USERNAME, but no one else works.
EDIT:
yeah so, i reread it and figured out that new users don't have to be added to the samba.conf file. i have two users working now
Last edited by dmizer; July 31st, 2006 at 07:46 AM.
1) Samba server howto | 2) mount windows/samba shares with CIFS + unicode | 3) best FTP server howto
4) NFS server/client howto | 5) Easy cross-platform LAN file sharing with FTP
6) Fix samba browsing!!! | 7) Fix Pulse audio
Happy Ubunting!
Hi!
Just came across your post; sorry for the delay *gomen*
Glad you figured it out ... as it's just a matter of adding and enabling the user(s) with smbpasswd.
- Storm
P.S.: As the "force user" and "force group" parameter seems to cause confusion here's a general hint for everyone ...
The parameter refers to the user/group to whom the files inside the shared directories will belong; it has nothing to do with access rights/priviledges!
storm....you're the man!.....I 've just started using Ubuntu....you're howto is so easy to follow that I got file sharing working in the first pass!...cheers to you dude!
tondemonai.
it only took me about 20 minutes and a reread of your first post to figure it out on my own. and i actuall made good use of that "force user, force group" to resolve a problem with some sensitive "boss only" access files.
you really are the man. vielen dank!
edit:
actually, i went back through and figured out why i tripped up on adding new users. it's in this line:
so no problem adding them to my system, but when you say "AND samba" i assumed you meant samba.conf.In case you need other users to be able to access the share you need to add them to your system AND samba as well. Make sure you use the very same Windows usernames and passwords!
Last edited by dmizer; July 31st, 2006 at 06:15 PM.
1) Samba server howto | 2) mount windows/samba shares with CIFS + unicode | 3) best FTP server howto
4) NFS server/client howto | 5) Easy cross-platform LAN file sharing with FTP
6) Fix samba browsing!!! | 7) Fix Pulse audio
Happy Ubunting!
Hi
Thanks for this great howto!
It worked out just fine.
However I got a problem with the user permissions.
I want my brother to access his folder and I want myself to access my own, but neither one of us should see the content of the others folders.
The problem is that "force user" doesn't seem to work.
Everyone can view all the folders. I tried messing around with chmod and chown, but it doesn't work out.
I also set up the users on the linux machine and did everything according to the howto!
I don't know what to do anymore. I really need user permissions, since there are files that some people should not see.
Can someone help please?
Flo
Sorry, I just read your post after posting my last one!Originally Posted by Stormbringer;1319971
The parameter refers to the user/group to whom the files inside the shared directories will belong; [b
I think I made that mistake as well.
Can you tell me than how I set up access permissions, like in windows, that would be very important!
Thanks in advance.
Flo
OK - let us start this way: could you please tell me what shares you configured (i.e. include the part in question into a reply)? Would make life easier as I won't have to guess.
However, let's assume the following - maybe we get a direct hit:
You and your brother have a user account on your Linux box and you want to access the HOME directories (/home/<username>)
- Open smb.conf for editing
Either type "sudo gedit /etc/samba/smb.conf" in a terminal or press ALT+F2 and input "gksudo gedit /etc/samba/smb.conf".
- Find the following section:
and change it to ...Code:; NOTE: If you need access to the user home directories uncomment the ; lines below and adjust the settings to your hearts content. ;[homes] ;valid users = %S ;create mode = 0600 ;directory mode = 0755 ;browseable = no ;read only = no ;veto files = /*.{*}/.*/mail/bin/
- Save the changesCode:; NOTE: If you need access to the user home directories uncomment the ; lines below and adjust the settings to your hearts content. [homes] valid users = %S create mode = 0600 directory mode = 0755 browseable = no read only = no veto files = /*.{*}/.*/mail/bin/
- Restart samba
Type "sudo /etc/init.d/samba restart" in a terminal
On Windows the shared home-directory (it's called by the username you have on your Linux box) should be automatically detected. If not, simply type \\<COMPUTERNAME>\<username> into the address bar of Windows Explorer - and if it doesn't work out by the name subsitute it with the ip address. Don't forget to input the correct credentials (username/password) when asked.
If you are running a different configuration I rely on your feedback ...
-Storm
Hi Storm thanks for your quick reply!
Here's the deal
My Network at home includes 3 Pcs and a server.
My brother: windows
My Dad: Windows
Me: Windows / Linux Hybrid
Since I use linux most of the time I was planning on just setting up normal shares for everyone (like I had it before when I had my windows server running) so everyone has his own area where he can store stuff and no one else but him can access it.
And than there is a global share called "Data" where I have stored all the programs, and installs (especially for windows) which me and my brother should have write permissions to, but my dead only read because he is very computer illiterate and I don't want him to mess up or delete files by accident.
So it was when I had set up the windows server and so I was thinking to do it with linux.
I have to say that I do not really understand the benefit of the /home directory thing.
AND the home directory is also on the system partition of the linux server, which means that I would have to move it one of the bigger HDDs in the server. (I could not find how to do that, so I stuck to the idea mentioned above, by just creating single shares)
I hope you could follow my description...
Here's my smb.conf:
Thanks for your nice help[global]
; General server settings
netbios name = SERVER
server string =
workgroup = WURM
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
passdb backend = tdbsam
security = user
null passwords = trues
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
printing = CUPS
printcap name = CUPS
syslog = 1
syslog only = yes
; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/
; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no
; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no
; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775
[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no
; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes
############ Fileshares begin here #############
[Data]
path = /media/hdb1
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
[Florian]
path = /media/hdc1/Florian
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = florian
force group = florian
[Lukas]
path = /media/hdc1/Lukas
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = lukas
force group = lukas
[Hans-Jörg]
path = /media/hdc1/Hans-Jörg
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0750
force user = hans-jörg
force group = hans-joerg
Flo
TYPING MISTAKE ENCOUNTERED!!!!
Please correct it to read "true"
Although you want ALL of your family to have access here you should set "force user" and "force group" to the user account with whom you usually work on your Ubuntu box - I assume it's yours ...
Please add...
force user = florian
force group = florian
As I already stated in the thread: the "force user" and "force group" parameter has nothing to do with access priviledges but with the permissions of the local linux filesystem. All authenticated users will have access here.
EDIT
Short explaination:
Setting a forced user/group will make sure that all files and folders will belong to the user that is working on the box - so you won't have any troubles accessing the files/folders from within Ubuntu.
To figure out the difference...
Do a
ls -lisa /media/hdb1/
and
ls -lisa /media/hdc1/Lukas
or
ls -lisa /media/hdc1/hans-joerg
The difference in the file permissions should be easily spotted.
/EDIT
To lock this share so that ONLY YOU will have access add the following line...
valid users = florian
Same here ... if ONLY lukas should have access add ...
valid users = lukas
Please refrain from using german umlauts - stick to plain ASCII (although Dapper supports UTF-8 without any hitches, at least for me, you better not try to trigger problems lurking in the dark corners). German Umlauts in the share declaration and/or path in the local filesystem may cause major issues. This, however, does not apply to the files you store on the share ... as long as >Windows< happily recognizes the correct characters you are fine.
Therefore, better delete the user account (from your system and with smbpasswd from samba) and make it up anew by writing is as "hans-joerg".
As soon as it's done add ...
valid users = hans-joerg
...to lock down the share for this user ONLY.
After you made the changes you need to restart samba (reloading doesn't always work out) --- sudo /etc/init.d/samba restart.
-Storm
Last edited by Stormbringer; August 1st, 2006 at 01:29 PM.
Bookmarks