Ubuntu_samba.sh
1 #!/bin/sh 2 3 echo "Ubuntu 14.04 文件服务器--samba的安装和配置" 4 echo "更新源列表" 5 sudo apt-get update 6 echo "安装samba" 7 sudo apt-get install samba samba-common 8 echo "新建共享目录并设置权限" 9 sudo mkdir /home/share 10 sudo chmod 777 /home/share 11 echo "新建访问共享资源的用户和设置密码" 12 sudo useradd smbuse 13 sudo smbpasswd -a smbuser 14 echo "重启samba服务" 15 sudo service smbd restart