LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1993|回复: 4

winxp访问samba服务器用户名是灰色的如何解决?

[复制链接]
发表于 2007-5-24 12:29:10 | 显示全部楼层 |阅读模式
在linux服务器上做两个共享文件夹public和redhat,可以匿名访问public文件夹,访问redhat需输入用户名,但用户名一栏为灰色不可输入该如何解决?
smb.conf配置如下:
security = share
username map = /etc/samba/smbusers
log file =/var/log/samba/log.%m
max log size =50
socket options = TCP_NODELAY
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[redhat]
comment = test
path = /home/redhat
public = no
writable = yes
valid users = @redhat
[public]
comment = test
path = /home/public
public = yes
 楼主| 发表于 2007-5-25 08:53:20 | 显示全部楼层
各位高手帮帮忙啊,遇到这问题很久都没解决,郁闷啊!!!也在google.com搜了也是没找到解决方法.
回复 支持 反对

使用道具 举报

发表于 2007-5-25 21:52:49 | 显示全部楼层
网上搜来的,试试看吧:
http://brneurosci.org/linuxsetup38a.html

Windows XP users unable to login

Symptom: When Windows XP users try to connect, they receive a grayed-out login dialog box with the username set to "Guest". It is impossible to change the username, and no password works. Only files owned by the guest account are accessible.

Solution: There are three things that may cause this.

   1. User logged in more than once If the user has already logged onto the Samba server from one computer, all attempts to login as the same user from any other computer are automatically changed to "Guest". Users are therefore prevented from accessing their home directories from more than one computer at a time.

      In some cases, changing the name of your user profile to something else has been known to work. XP then thinks you are someone else, and provides a dialog that allows the user to enter both the username and the password.
   2. Simple File Sharing turned on in XP machine According to Microsoft, with Simple File Sharing in force, all incoming connections authenticate as Guest, regardless of whether they have a valid user account or not. There are no passwords or access restrictions. Simple File Sharing is the only type of sharing available in Windows XP Home Edition. Open Windows Explorer and go to Tools->Folder Options->View and uncheck ``Use Simple File Sharing''. Turning the guest account off in the control panel does not disable it.
   3. No guest account on XP machine If Simple File Sharing ( and hence ForceGuest ) is in force, but the Guest account has been disabled, then users will not be able to connect. Connections from an XP box will get prompted to supply credentials:

      A Password is required:
      Username: XP-Box\Guest ( Greyed out);
      Password:

      No password will work, because Guest is disabled.

Symptom: Another problem that sometimes occurs in XP is when a user tries to use two different resources on the server, such as a shared printer and their home directory. Sometimes the connection works, but it is intermittent. Other times, the username is automatically set to "guest" and access to their home directory is denied. Users get some or all of the following error messages:

Could not reconnect all network drives
Disconnected Drive
\\server\homes is not accessible. You might not have
permission to use this network resource. Contact the
administrator of this server to find out if you have
access permissions. Access is denied

Solution: Needless to say, the problem has nothing to do with permissions. It is merely Windows goofing up the passwords again. The solution is to change to from "security=share" to "security=user". In Samba, change /etc/samba/smb.conf as follows:

   security = user
;    announce as = NTServer (this is commented out)
   domain logons = yes
   mangle case = yes
   revalidate = yes

The last two options are said to help for Windows XP users, but I have never noticed any difference from these two options. While changing security to "user" allows XP users to connect effortlessly, it messes things up for Windows NT and 2000. W2K will now insist that the user supply a password, while NT will be unable to print. The solution is to add a dummy password/username combination such as staff/staff in Samba, using the commands

useradd staff
smbpasswd -a staff

This will allow W2K to satisfy its craving for a password, while the other Samba access controls prevent unauthorized access. Although the new user "staff" has to be present in /etc/passwd, the password should only be set in Samba, not on the system. You must leave the "staff" account locked (i.e., don't type 'passwd staff', and make sure their shell is set to /bin/false). But you already knew that.
回复 支持 反对

使用道具 举报

发表于 2007-5-27 04:01:36 | 显示全部楼层
valid users = @redhat   
这里设置有问题... valid users =  你的用户名就可以了.
回复 支持 反对

使用道具 举报

发表于 2007-5-28 22:01:53 | 显示全部楼层
Post by Lssac
valid users = @redhat   
这里设置有问题... valid users =  你的用户名就可以了.


楼上应该是正解。另外,你用smbpasswd命令添加用户名和密码没有?
用法:
smbpasswd -u username
按提示输入密码
另外,用户名应该是系统中已经存在的用户名,不然会提示你无法登录。因为共享的目录一般不会设置成任何人都可以读取。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表