编写脚本
[root@localhost ~]# vim dd.sh
#!/bin/bash
yum -y install samba
mkdir -p /home/shar sss ddd
echo " [share]
comment = Shared Folder
path = /home
browseable = yes
writable = yes
guest ok = yes
" > /etc/samba/smb.conf
chmod +x /home/*
useradd qqqq
smbpasswd -a qqqq
systemctl restart smb
systemctl restart nmb
systemctl stop firewalld
启动脚本
[root@localhost ~]# sh dd.sh
windows登陆
win+r

输入用户名密码

进入

查看创建是否成功
创建文件测试


写入测试

查看文件内容
[root@localhost ~]# cd /home
[root@localhost home]# ll
总用量 0
drwx------. 2 qqqq qqqq 128 8月 7 21:05 qqqq
drwx--x--x. 2 qwe qwe 62 6月 19 21:52 qwe
drwxr-xr-x. 2 root root 6 8月 7 20:57 shar
[root@localhost home]# cd qqqq/
[root@localhost qqqq]# ll[root@localhost qqqq]# ll
总用量 4
-rwxr--r--. 1 qqqq qqqq 18 8月 7 21:06 qqq.txt
-rwxr--r--. 1 qqqq qqqq 0 8月 7 20:58 新建 文本文档.txt[root@localhost qqqq]# vim qqq.txt
你是谁我是我





![智慧水利整体解决方案[43页PPT]](https://img-blog.csdnimg.cn/img_convert/fac9d85bb599af888c0454fe96fa7ff1.jpeg)












