LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2005, 06:47 PM   #1
gizmo911uk
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Rep: Reputation: 0
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.

____________________________________________________________________
-----------------------------------------------------------------------------------------------
 
Old 09-08-2005, 12:36 AM   #2
vdberj
LQ Newbie
 
Registered: Jan 2005
Location: Pretoria, South Africa
Distribution: Fedora Core 3 / Gentoo
Posts: 9

Rep: Reputation: 0
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.
 
Old 09-08-2005, 12:42 AM   #3
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.
 
Old 09-08-2005, 04:42 AM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
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
 
Old 09-08-2005, 05:11 AM   #5
vdberj
LQ Newbie
 
Registered: Jan 2005
Location: Pretoria, South Africa
Distribution: Fedora Core 3 / Gentoo
Posts: 9

Rep: Reputation: 0
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.
 
Old 09-08-2005, 01:23 PM   #6
gizmo911uk
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 09-08-2005, 11:49 PM   #7
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally posted by vdberj
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.
Yeah not the best for security, 2775 will definitely be better. Shouldn't need to execute anything from the directory if your just moving files to and from.
 
Old 09-11-2005, 06:42 PM   #8
gizmo911uk
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 09-12-2005, 03:13 AM   #9
vdberj
LQ Newbie
 
Registered: Jan 2005
Location: Pretoria, South Africa
Distribution: Fedora Core 3 / Gentoo
Posts: 9

Rep: Reputation: 0
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
 
  


Reply



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
How to Add a Hard Drive? notooth Linux - Newbie 12 10-26-2005 04:16 PM
Add hard drive Wardy Linux - Newbie 3 01-19-2005 05:34 PM
How to add a hard drive vicvac Linux - Hardware 9 03-18-2004 02:17 PM
add hard drive mnauta Linux - Hardware 1 01-09-2004 04:02 PM
Add a new hard drive to existing RH 7.2 guanyu Linux - Software 1 02-27-2002 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:18 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
Open Source Consulting | Domain Registration