LinuxQuestions.org
Review your favorite Linux distribution.
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 07-27-2005, 11:40 AM   #1
Mrpeepers310
LQ Newbie
 
Registered: May 2005
Distribution: Suse 10.1
Posts: 23

Rep: Reputation: 15
Samba password protected shared Folder


I am running suse 9.3 pro on a laptop and i want to be able to share a single folder but put a password on it so whoever wants to browse it has to know the password. i don't want to use a local account because that means that windows users can get into that folder. Also i am running a simple home network with work-groups and such so there is no domain possibility. I just want a single folder to have a password whenever someone logs on to it.

How to i add simple password protection to a shared folder?

Thanks!
 
Old 07-27-2005, 08:09 PM   #2
mpeg4codec
Member
 
Registered: Jul 2005
Distribution: Debian, Gentoo, self-built [not LFS]
Posts: 109

Rep: Reputation: 15
You can map an SMB username onto the Unix user ``nobody''. Since SMB passwords are stored separate from Unix passwords, you don't have to worry about people getting access to the machine.

Give /etc/samba/smbusers a line like this:

nobody = private

And give the user nobody a Samba password:

smbpasswd -a nobody

For the share itself, share it like this:

Code:
[share]
	writable = yes
	browseable = no
	public = no
	valid users = nobody
	path = /path/to/share
Now you should be able to access the share with the username private and the password you gave to nobody.

If this doesn't fit what you wanted to do, just say so. I can help, so just ask away.
 
Old 07-28-2005, 12:48 AM   #3
Mrpeepers310
LQ Newbie
 
Registered: May 2005
Distribution: Suse 10.1
Posts: 23

Original Poster
Rep: Reputation: 15
nope just what ive been looking for! wow thanks for the quick reply! now can i make the user name something else that nobody. like make up a user name?
 
Old 07-29-2005, 01:09 AM   #4
Mrpeepers310
LQ Newbie
 
Registered: May 2005
Distribution: Suse 10.1
Posts: 23

Original Poster
Rep: Reputation: 15
hey another quick question! is there a way i can make that shared folder visible to all yet still need a password to access it? right now it is invisible on the network when i browse my box.

but thanks for you help i finally understand samba a bit more than i did u filled up a few of the gaps
 
Old 07-29-2005, 08:36 AM   #5
mpeg4codec
Member
 
Registered: Jul 2005
Distribution: Debian, Gentoo, self-built [not LFS]
Posts: 109

Rep: Reputation: 15
For your first question, since you have this line in /etc/samba/smbusers:

nobody = private

that means you can connect as the user private. In other words, the user ``private'' is a nickname for nobody. If you wanted to use another name as well as private, you should change it to something like this:

nobody = private readonly

As for your second question, to make it visible, change the browseable line to read:

browseable = yes

Having ``browseable = no'' is like having a share in Windows with the $ on the end of its name. In Samba, you can make a share hidden no matter what it's named. Best of both worlds.
 
Old 09-18-2010, 10:04 AM   #6
miker@cancog.com
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Rep: Reputation: 0
Interesting stuff, here's my situation. We have a public share setup for all staff to use, with all types of folders branching off from this public share. Most of our people are not very good with computers and can just do the basics. so to keep things fairly simple for all users I would like to keep the shares the way they are but, I would like to add a level of security to some (but not all) of the folders under the public share. I would like to be able to have some of the folders have a password, no user name. So if somebody clicks on a certain folder, they would then need to put in a password to continue on. I have read the samba text book cover to cover and can't find anything on this particular strategy. Any help that somebody can offer would be greatly appreciated. Thanks.
 
  


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
Samba Public shared Folder will not hold permissions xzerros Linux - Networking 12 09-26-2005 09:25 AM
Samba problems: can't write to shared folder Nylex Linux - Networking 4 07-19-2005 04:40 PM
SAMBA shared folder is not refreshed immediately nodil Ubuntu 0 06-08-2005 12:43 AM
Password Protected Folder? crab_2004 Linux - Software 2 02-22-2004 10:50 PM
Apply permission on samba shared folder on M$ Windows 2000 vwhk Linux - General 4 07-20-2003 09:53 PM

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

All times are GMT -5. The time now is 07:03 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