安装Samba服务
##服务器 web01 192.168.178.124
1.安装samba
[root@web01 ~]# yum install samba -y
2.配置主配置文件
[root@web01 ~]# cat /etc/samba/smb.conf -n
#修改smb.conf如下,添加以下参数
[josen]
comment = This is test configure
path = /home/josen
public = no
writable = yes
guest ok = yes
3.创建用于访问samba共享资源的账户信息
[root@web01 ~]# id josen
uid=1002(josen) gid=1002(josen) 组=1002(josen)
[root@web01 ~]# pdbedit -a -u josen
new password:
retype new password:
Unix username: josen
NT username:
Account Flags: [U ]
User SID: S-1-5-21-2323558867-1840456178-3426517114-1001
Primary Group SID: S-1-5-21-2323558867-1840456178-3426517114-513
Full Name:
Home Directory: \\web01\josen
HomeDir Drive:
Logon Script:
Profile Path: \\web01\josen\profile
Domain: WEB01
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 三, 06 2月 2036 23:06:39 CST
Kickoff time: 三, 06 2月 2036 23:06:39 CST
Password last set: 三, 10 2月 2021 16:23:28 CST
Password can change: 三, 10 2月 2021 16:23:28 CST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
4.检查用于共享的资源目录,注意权限
[root@web01 ~]# ll /home/josen
总用量 0
5.重启smb服务
[root@web01 ~]# systemctl restart smb
[root@web01 ~]# systemctl restart smb
6.在自己的机器登录smb,输入账户密码
7.读写测试
[root@web01 ~]# cd /home/josen
[root@web01 josen]# ls
[root@web01 josen]# mkdir {a..e}.txt
[root@web01 josen]# ls
a.txt b.txt c.txt d.txt e.txt