leng_cn 发表于 2013-1-31 02:05:11

在linux上安装配置samba服务器(linux充当文件服务器)

总是忘记这个东东,这次我把他记好,嘿嘿
启动samba服务

# service smb start   (启动samba服务)
Starting SMB services:
Starting NMB services:
# testparm         (检查配置文件的正确性)
Load smb config files from /etc/samba/smb.conf
Processing section ""
Processing section ""
Processing section ""
Loaded services file OK.
Press enter to see a dump of your service definitions

创建一个samba用户

    该用刻户在windows下有没有都无所谓。

1)建一个系统用户

# useraddsamba      (建一个名叫samba的用户)
# passwd samba      (给samba用户添加密码)
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)然后创建samba帐户

# smbpasswd -a samba
(-a必须加,为了生成密码文件smbpasswd,该密码是windows登陆Linux的samba用户密码)
New SMB password:
Retype new SMB password:
unable to open passdb database.
Added user samba.

3)查看一下生成的用户名、密码

# vi /etc/samba/smbpasswd
samba:500:A9C604D244C4E99DAAD3B435B51404EE:ACB98FD0478427CD18949050C5E87B47::LCT-468268E6:

4)重新启动samba服务

# service smb restart
Shutting down SMB services:
Shutting down NMB services:
Starting SMB services:
Starting NMB services:

最后阶段,进行测试

1)先按照主配置文件所指定的位置,建好要共享的资源。

# mkdir samba   (建/usr/samba文件夹)
# chmod 777 /usr/samba   (samba服务器受本地文件系统权限和共享权限两种权限,而且是取最严格的权限,为了方便就把本地权限都给足好了)
# cd samba
# vi aaa.txt

2)在Windows客户机的地址栏中输入samba服务器ip(如“\\192.168.138.110)
页: [1]
查看完整版本: 在linux上安装配置samba服务器(linux充当文件服务器)