LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   samba user authentication (https://www.linuxquestions.org/questions/linux-newbie-8/samba-user-authentication-691844/)

fizeelinux 12-20-2008 01:43 AM

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

taylorkh 12-20-2008 06:40 PM

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 :-(

fizeelinux 12-26-2008 11:40 PM

Quote:

Originally Posted by taylorkh (Post 3382494)
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.

billymayday 12-26-2008 11:54 PM

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"


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