Hey People,
if you are wondering how to make a share on a mounted filesystem WITHOUT getting a password window everytime you connect to it (or the nasty ACCESS DENIED in windows, and needing to connect as a different user to access the share).
This is what you will be wanting if you read this whole post.
---------------------------------------------------------------------------
You have a partition for storage on your computer, and it is
not a Linux fs. You want to share a directory on that partition so people can upload\download stuff from you (You would'nt want to share your Linux partition because you don't want people uploading to your system partition until it's Full, and no space is left for the OS anymore).
You want users to be able to access the share
without a password warning.
The share is a public one. So you want anyone to have XS to it
OR
You want to share the same directory in Linux
AND windows.
So the partition you will be sharing something on is either FAT or NTFS.
The share is a public one. So you want anyone to have XS to it
---------------------------------------------------------------------------
The main Problem in both cases
If you mount a partition it will be owned by the user who mounting it. Samba won't allow guest users to connect to it because the Samba guest account has no permission in the mounted directory.
What happens is: you will always have to connect as the user the partition was mounted by!
wich is annoying in windows and other smb-cleints in general (you will have to connect\login with the user who mounted the share-directory). Not very user friendly for a public share.
I could not find anything about this on google, thought of something, it worked, so now I'll share it for people having the problem I had.
How to make it work
[edit]
just use this, it's much more easy:
http://www.cis.ksu.edu/~aruljohn/lin...ssWindoze.html
it comes down to,fstab:
Code:
/dev/hda5 /mnt/Storage auto user,rw,exec,umask=000 1 0
How to get the share working without any password, the Samba guest user will have to have access to the mounted dir.
First make sure you set the Samba guest user (in newer Samba versions I believe the user nobody is used by default, but you can still conduct the following steps just to garanty it will work).
-First add the following lines to the smb.conf (usually in /etc/samba):
[edit /etc/samba/smb.conf with your favorite editor as root]
[global]
guest account = nobody
[netshared]
comment = Network Profiles Service
path = /mnt/netshared/sharedir
read only = No
writable = yes
store dos attributes = Yes
create mask = 0600
directory mask = 0700
browseable = yes
guest ok = yes
printable = no
please make sure you have a user 'nobody', if not create one with the "adduser" command, leave the password blank (so just press [RETURN] a few times when asked for a Pass).
-Create the directory for the share with the user nobody.
Type as root:
[in console]
su nobody
cd /mnt
mkdir netshared
exit
-Now add the partition you want to mount to fstab (usually in /etc):
[/etc/fstab with favo editor as root]
/dev/hd** /mnt/netshared auto defaults,user,noauto,rw 1 0
where * is, use your setting, use "ro" instead of "rw" if you only want Read-Only permissions, you can also do this from the smb.conf file with the " writable = YES/NO" setting.
-/mnt/netshared will not be mounten automaticly because we will mount it as the guest user of Samba (user:nobody). This we can automate by adding the following line to your startup local script,
rc.local (/etc/rc.d for slackware, I don't know where these scripts are on other distro's but you can try to find them with the command "locate rc.local" or "locate rc.*" or "locate *local*")
Add this line to your startup script:
[/etc/rc.d/rc.local with favo editor as root]
#Mount public share on Fat32 Storage partition,so everyone can use them.
su nobody -c "mount /mnt/netshared"
-Last but not least, Execute the script(rc.local) to mount the shared directory:
[In console]
root@My_Hostname:~# cd /etc/rc.d
root@My_Hostname:/etc/rc.d# ./rc.local
root@My_Hostname:/etc/rc.d#
Now, make sure the directory "sharedir" exists on the partition, if not create it with "mkdir /mnt/netshared/sharedir".
NOTE: the partition must be succesfully mounted before you want to do this. (if you got any errors after executing the script, the mount failed, then if you create the DIR 'sharedir', files uploaded to the share will still be stored at your Linux (system) partititon.
well guys, it's been a blast
, CU
grtz SRKI
psI presume you know how to share the "sharedir" directory in windows.(i.e.[Right-Click on folder]>Share>)