Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-24-2012, 05:55 AM   #1
Registered: Jul 2012
Location: Rome
Distribution: RHEL6, CentOs
Posts: 92

Rep: Reputation: 1


I cannot understand the reason about samba sharing.

I've got a RHEL6 server and a Windows7 Laptop. This is what I do

1. I create the user i will enable to look the directory and add a new pass

useradd -g groupname username

passwd username

2. in /etc/samba/smb.conf i add the following lines

### Samba - Relax ###
comment = Sharing directory for username
browseable = yes
path = /mainuser/shared_directory
valid users = username
writeable = yes
guest ok = yes
printable = no

Note : The directory owner is "username" and group "groupname" , permission are 755

3. then i add to /etc/samba/smbusers

groupname = username

4. last, i enable the user to access the directory

smbpasswd -e username


When I try from Windows to access it denies with an error message that describe i have no authorization to access.

The password of "adduser" command and "smbpasswd" command it's the same.

To access i do

i insert \\serveraddress\sharing_name

My question about that :

1. It's necessary to add the user both with "adduser" and "smbpasswd" ? Why?
2. The user i created "username" it is the user i enable to access the directory. I do not need to have that user on windows but i have some confusion about that.
3. What am I Wrong?

Thank you

Last edited by adol83; 10-24-2012 at 05:59 AM.
Old 10-24-2012, 08:46 AM   #2
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Hi Davide,
What Unix username you've created? and are both your Windows and Unix systems can access each other or are in same network?
In order to access Unix data from Windows, a user's Unix and Windows usernames should be mapped in smbusers. So did you map them in /etc/samba/smbusers, like:

Also if systems are not in same domain name then you should try with path: \\<FQDN-Unix-system>\<dir>
One more thing, as far as I know, entry of groupname is not needed in smbusers while configuring user to use samba.

Last edited by shivaa; 10-24-2012 at 08:48 AM.
1 members found this post helpful.
Old 10-24-2012, 09:52 AM   #3
Registered: Jul 2012
Location: Rome
Distribution: RHEL6, CentOs
Posts: 92

Original Poster
Rep: Reputation: 1
Now it works. I explain because i usually make a mountain out of a mole hill,

I was in trouble because I already did a samba sharing with "username2" and it was working. I couldn't understand at first instance.

Then i found out that I was inside Windows7 as "username2" (an user i created and it works well for Samba sharing) , i switched to "username" and i tried to connect to the samba sharing so it worked out.

Thanks Shiva!



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
How to make samba read updated smb.conf file without restarting samba rjo98 Linux - Newbie 12 03-14-2016 12:19 PM
Samba/Cups print sharing problems (/var/spool/samba files) Gates1026 Linux - General 9 06-23-2013 02:33 AM
[SOLVED] SAMBA problem ?? rebuilding server ?? How to configure SAMBA share with writing - Win Alvin88 Linux - Newbie 5 04-04-2012 01:51 AM
[Samba] Samba as PDC stopped trusting my Win 7 clients after a server update martdj Linux - Networking 1 01-14-2011 11:30 AM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 06:54 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration