LinuxQuestions.org
Review your favorite Linux distribution.
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 10-20-2004, 03:52 PM   #1
SRKI-Neo
LQ Newbie
 
Registered: Oct 2004
Posts: 2

Rep: Reputation: 0
[SAMBA]HOWTO Sharing vfat or any other mounted fs as guest(no pass when connect)


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>)

Last edited by SRKI-Neo; 10-23-2004 at 06:16 PM.
 
  


Reply


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
Samba - sharing mounted NTFS partition SirAeryn Linux - Networking 2 09-11-2005 08:54 PM
(re)sharing an nfs-mounted folder with samba rtspitz Linux - Networking 1 02-13-2005 01:36 PM
HoWTO | Sharing files with Samba the_gripmaster SUSE / openSUSE 4 01-08-2005 10:55 PM
Why don't file and print sharing of Samba pass throgh PPP connection? ritsasa Linux - Networking 1 03-08-2004 07:35 AM
VFAT mounted or Samba sx10 Linux - General 5 01-29-2002 10:39 PM

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

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

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