LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-20-2008, 01:43 AM   #1
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Rep: Reputation: 15
Wink samba user authentication


Hai all i have a setup a samba server and accessing the samba share from by windows xp machine....i have given the share 'doc1' folder with 777(permission) and 'doc' folder also with 777...And i have assigned user authentication for the folders ...The configuration file is as below...Both the shares are working perfectly..Problem is for the first time when i try to access the share from my windows machine(\\samba machine ip addr) it tells connecting to 'samba server name' prompting for user name and password i gave one of the user name say 'prasanna',it got in displaying both the folders...As per my configuration file samba user prasanna(in this case) should not be able able to access 'doc' folder...I tried to access the doc1 folder thinking that it will give me a error message like 'access denied' but it again prompted me for the usrname and password i gave the username as prasanna and its relevant password but it is neither logging in nor displaying error...it justs sticks to that screen...
The thing what i found was only a user is able to access his assigned resource in windows xp..even when he tries to access a folder that is not assigned to him he is not shown any error message but provided with user authentication prompt that is of no use.. I am very new to linux ..nay little help is greatly appreciated...Thanks in advance.......


[doc]
comment = Public Stuff
path = /doc/
#public = yes
writable = yes
valid users = yousuff,prasanna
guest ok = no

[doc1]
comment = Public Stuff
path = /doc1/
#public = yes
writable = yes
valid users = yousuff
guest ok = yes
 
Old 12-20-2008, 06:40 PM   #2
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Have you created samba accounts for the XP users on the samba server? This can be done by root as follows. Open a terminal window.

If the samba server is on Debian, Ubuntu or any distro which uses sudo, type
sudo smbpasswd -a username <Enter> You will then be prompted for the root password and then the password to assign to the username. If username is the same as the user's name on XP and the password is also the same - it will not be necessary for the user to enter them when connecting to the samba server.

If the samba server is on Red Hat, Fedora, CentOS or another Linux which uses su, do the following. Type su - <Enter> then enter the password for root. The smbpasswd command is the same - just omit sudo.

As to the permissions on the samba shares... If this samba server is just for fun and not in a production environment - I would probably create a matching Linux account for each XP user then control access to the folders from within Linux using user and group permissions. Controlling user by user permissions within the smb.conf file would be rather cumbersome. If nothing else your would have to restart the samba services each time you made a change - thus disconnecting anyone accessing the samba server at that time.

See if this helps to accomplish what you are trying to do. If not, please feel free to ask more questions.

Ken

p.s. Make sure your firewall on XP allows connections to the samba server. When I first started to use samba some years ago I installed it and made a couple of configuration changes and it WORKED!!! I was quite pleased. Then a few days later it stopped. I spent more than 6 months on and off messing with it - I unstalled an ftp server and used that to move files between XP an Linux. Finally I found that an upgrade to the Zone Alarm firewall program decided to protect the XP PC from other PCs in its workgroup. By then I had upgraded samba, uninstalled and reinstalled samba, reinstalled Linux etc. All to no effect :-(
 
Old 12-26-2008, 11:40 PM   #3
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by taylorkh View Post
Have you created samba accounts for the XP users on the samba server? This can be done by root as follows. Open a terminal window.

If the samba server is on Debian, Ubuntu or any distro which uses sudo, type
sudo smbpasswd -a username <Enter> You will then be prompted for the root password and then the password to assign to the username. If username is the same as the user's name on XP and the password is also the same - it will not be necessary for the user to enter them when connecting to the samba server.

If the samba server is on Red Hat, Fedora, CentOS or another Linux which uses su, do the following. Type su - <Enter> then enter the password for root. The smbpasswd command is the same - just omit sudo.

As to the permissions on the samba shares... If this samba server is just for fun and not in a production environment - I would probably create a matching Linux account for each XP user then control access to the folders from within Linux using user and group permissions. Controlling user by user permissions within the smb.conf file would be rather cumbersome. If nothing else your would have to restart the samba services each time you made a change - thus disconnecting anyone accessing the samba server at that time.

See if this helps to accomplish what you are trying to do. If not, please feel free to ask more questions.

Ken

p.s. Make sure your firewall on XP allows connections to the samba server. When I first started to use samba some years ago I installed it and made a couple of configuration changes and it WORKED!!! I was quite pleased. Then a few days later it stopped. I spent more than 6 months on and off messing with it - I unstalled an ftp server and used that to move files between XP an Linux. Finally I found that an upgrade to the Zone Alarm firewall program decided to protect the XP PC from other PCs in its workgroup. By then I had upgraded samba, uninstalled and reinstalled samba, reinstalled Linux etc. All to no effect :-(

Hi Ken,
My problem has been sorted out.But each time i need to run this command in xp machine for it to check for authentication when trying to access samba share.(or else the user with which i first logged in samba share folder will be displayed until the window xp system reboot)..

Cmd 1.go to command prompt type net use and then enter
2.It displays the existing share connection
3.delete the connection by using the parameter /delete


C:\>net use
New connections will be remembered.


Status Local Remote Network

-------------------------------------------------------------------------------
OK \\192.170.50.33\IPC$ Microsoft Windows Network

The command completed successfully.

And i deleted using the following command


C:\>net use \\192.170.50.33\IPC$ /delete
\\192.170.50.33\IPC$ was deleted successfully.

Now when i try to access the samba machine it prompts for the samba username and password.

Hope this information is useful.

Last edited by fizeelinux; 12-26-2008 at 11:42 PM.
 
Old 12-26-2008, 11:54 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Isn't the root cause of the wrong user being able to see the second share that you've got

guest OK = yes

?

Try changing that to "no"
 
  


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
PAM Active Directory user authentication for Samba shares in RHEL 4 rockfx01 Linux - Server 3 12-02-2008 01:02 PM
How do you test samba user authentication with smbclient? Thaidog Linux - Server 2 09-17-2008 02:48 AM
how to setup my samba server using my current Novell LDAP user authentication? hocheetiong Linux - Newbie 1 05-06-2008 05:05 AM
Samba - Authentication for user FAILED reeaver Linux - Software 0 09-03-2005 05:06 PM
Samba PDC , LDAP user authentication , what about Machines ? Jingle Linux - Enterprise 0 07-22-2005 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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