扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
在本页阅读全文(共2页)
◆5、添加可以访问我们刚才设置共享目录的用户:testuser
1)建一个系统用户
[root@linux samba]# useradd testuser (建一个名叫testuser的用户)
[root@linux samba]# passwd t (给testuser用户添加密码)
Changing password for user samba.
New password: (密码要六位以上,不显示在屏幕上)
BAD PASSWORD: it does not contain enough DIFFERENT characters
Retype new password: (确认密码)
passwd: all authentication tokens updated successfully
2) 更新 /etv/samba/smbpasswd 文件
[root@linux samba]# cat /etc/passwd | mksmbpasswd.sh >/etc/samba/smbpasswd
3) 然后创建samba帐户
[root@cisco samba]# smbpasswd -a testuser
New SMB password:
Retype new SMB password:
Added user testuser.
6、重新启动smb服务
[root@cisco samba]# service smb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]
[root@cisco samba]# service nmb restart
Shutting down NMB services: [ OK ]
Starting NMB services: [ OK ]
◆测试:两个系统进行相互访问
下面我们在Windows下测试一下,我的系统为Windows xpsp3
在Linux下访问Windows的共享资源,显示信息为:
[root@cisco samba]# smbclient -L //192.168.1.10
Password:
Domain=[XPSP3] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
Printer Adobe PDF OfficeDocument Image Writer
session request to 192.168.1.10 failed (Called name not present)
session request to 192 failed (Called name not present)
Domain=[XPSP3] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Server Comment
--------- -------
Workgroup Master
--------- -------
在Linux 下访问自己的samba服务器,显示信息为:
[root@cisco samba]# smbclient -L //192.168.1.12
Password:
Anonymous login successful
Domain=[MSHOME] OS=[Unix] Server=[Samba 3.0.26a-6.fc8]
Sharename Type Comment
--------- ---- -------
homes Disk Home Directories
rose Disk This is my samba server!
test-1 Disk This is my samba server!
IPC$ IPC IPC Service (Samba)
Anonymous login successful
Domain=[MSHOME] OS=[Unix] Server=[Samba 3.0.26a-6.fc8]
Server Comment
--------- -------
MM'S SAMBA Samba
Workgroup Master
--------- -------
MSHOME
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。