How do i add a second hard drive to use for unrestricted file sharing?
Hi all.
Well first off i am using a cobalt qube 3 sever which uses linux 2.4 (thats why am here) and this is what i want to know? How do i add a second hard drive to use for unrestricted file sharing? By this i mean no user privileges/rights, etc.. etc.. etc.. just a free for all area. I have been able to get my new hard drive partitioned, formated and mounted as "/home1" and i have started editing the smb.conf file to share the whole drive out. I have been able to get it so i can view the share in my win xp machine but i am not able to write anything to it, i get access denied. This is the code i added to the bottom if the smb.conf file, what am i doing wrong? ;;start unrestricted area. [Shared] comment = shared drive available = 1 path = /home1 guest only = yes writable = yes browsable = yes public = yes create mask = 777 directory mask = 777 guest ok = true ;;end unrestricted area. ____________________________________________________________________ ----------------------------------------------------------------------------------------------- here is a copy of my smb.conf file, which may help. ----------------------------------------------------------------------------------------------- ; Samba Configuration ; Revision 1.0 for the 2700RJ, jdblair@cobaltnet.com 17.oct.98 ; ; DO NOT USE THE \ CONTINUATION! THE QUBE PARSING CODE WILL CHOKE ON IT! ; [global] max connections = 25 guest account = guest-share client code page = 850 workgroup = LOANE-NET domain logons = no domain master = no wins support = no printer admin = @winshare log file = /var/log/samba/log time server = yes logon home = \\%L\%U logon path = \\%L\profiles\%U\profile add user script = /sbin/addWindowsMachine.pl domain admin group = @winshare username map = /etc/samba/smbusers nt acl support = yes map to guest = bad user server string = Cobalt Qube 3 os level = 1 short preserve case = yes preserve case = yes local master = yes lock directory = /var/lock/samba locking = yes strict locking = yes security = user socket options = TCP_NODELAY max log size = 5000 veto files = /Network Trash Folder/.AppleDouble/.AppleDesktop/Icon / encrypt passwords = yes dead time = 5 debug level = 1 dns proxy = no local master = yes preferred master = yes alternate permissions = no browseable = yes case sensitive = no default case = upper delete readonly = yes follow symlinks = yes locking = yes mangle case = no map hidden = yes map system = yes oplocks = yes preserve case = yes short preserve case = yes strict locking = yes delete veto files = yes wide links = yes security mask = 777 directory security mask = 777 ; [homes] comment = Home Directories browseable = no read only = no create mask = 0755 ; ;;home begin -- do not edit this line [home] available = 1 comment = share for home valid users = admin @home create mask = 664 directory mask = 775 path = /home/groups/home writeable = yes ;;guest ok = true ; ;;home end -- do not edit this line ;;guest-share begin -- do not edit this line [guest-share] available = 1 comment = share for guest-share create mask = 664 directory mask = 775 path = /home/groups/guest-share writeable = yes guest ok = true ; ;;guest-share end -- do not edit this line ;;restore begin -- do not edit this line [restore] available = 1 comment = share for restore valid users = admin @restore create mask = 664 directory mask = 775 path = /home/groups/restore writeable = yes ;;guest ok = true ; ;;restore end -- do not edit this line [netlogon] browseable = yes comment = Network Logon Service guest ok = yes writeable = no share modes = no path = /home/netlogon [profiles] guest ok = no writeable = yes path = /home/profiles ;;start printers section. DO NOT EDIT THIS LINE [printers] available = 0 path = /var/spool/samba print ok = yes printing = lprng load printers = yes guest ok = no printcap file = /etc/printcap print command = /usr/bin/lpr -P%p -r %s lpq command = /usr/bin/lpq -P%p lprm command = /usr/bin/lprm -P%p %j lppause command = /usr/sbin/lpc hold %p %j lpresume command = /usr/sbin/lpc release %p %j queuepause command = /usr/sbin/lpc -P%p stop queueresume command = /usr/sbin/lpc -P%p start ;;end printers section. DO NOT EDIT THIS LINE ;;start print section. DO NOT EDIT THIS LINE [print$] path = /usr/local/samba/printers guest ok = yes browseable = yes read only = yes write list = @winshare,root ;;end print section. DO NOT EDIT THIS LINE ;;start unrestricted area. [Shared] comment = shared drive available = 1 path = /home1 guest only = yes writable = yes browsable = yes public = yes create mask = 777 directory mask = 777 guest ok = true ;;end unrestricted area. ____________________________________________________________________ ----------------------------------------------------------------------------------------------- |
Does your "guest-share" user have full write and create access to the actual files? Do a su - guest-share on your shell and try to create files there...
Most likely you will have to add the relevant mount options to your /etc/fstab to enforce ownership on that mount to guest-share, or a simple chown -R guest-share:guest-share /home1 will suffice. |
Try adding:
read only = no security = share Top line should be analogous to "writable = yes" but you never know and the bottom line should help you out also by lowering security. |
smb.conf permissons only work across the network, you still need to change the unix permissions on the directories themselves, try changing the permissions to 777 ( read, write and execute):
chmod 777 -R /home1 |
imho not the best thing to do, as this will make all files executable as well, and new files, due to the user's umask will in anyhow not be writable by all users.
Rather set up a group: groupadd everyone Add the users who need access to this group (remember to also add your samba guest user) usermod -G everyone[,current groups] [username] And then do something like this to /home1 chgrp -R everyone /home1 find /home1 -type d | xargs chmod 2775 find /home1 -type d | xargs chmod u+w find /home1 -type d | xargs chmod g+w The 2775 above will give all users in the group that owns the dir access to that directory, as well as forcing the group ownership to stay the same, even if the user doesn't have the group as his/her primary group. This would be a longer term sollution. |
Thanks for all your replies havn't got round to doing anything yet as i am only home from work, so will try later.
I have also been looking at my big linux book and was wondering about formatting the hard drive as fat32, would this be a way of removing all premissions and from what i can see i could take advantage of this as well, it being windows compadtiple and all. |
Quote:
|
didn't really get much chance to work with my server until now. I decided to format my drive as fat32, seemed to be the easiest option.
and here is my fstab entry: /dev/hdb1 /shared vfat defaults,umask=000 0 0 and here is my smb.conf entry: ;;start unrestricted area. [Shared] comment = Shared Drive - FAT32 path = /shared guest ok = true browseable = yes writeable = yes read only = no public = yes create mask = 0777 directory mask = 0777 ;;end unrestricted area. I can now create files and folders in my new shared drive using my win xp machine but the files are not visible, although the folders however are. What have i done wrong and how do i correct this. |
You need entries in your fstab that will force the ownership of the mount to the same user that your samba will use to access the mount.
Eg: /dev/hdb1 /home1 smbfs defaults,uid=guestuser,gid=everyone,umask=0002 0 0 |
All times are GMT -5. The time now is 07:19 AM. |