(1)安装
Java代码
- # yum -y install samba
- Installed:
- samba.i686 0:3.6.9-169.el6_5
- # pdbedit -a rensn
- new password:123456
- retype new password:123456
- ……
(2)Home文件夹
Java代码
- # mkdir /etc/skel/samba
- # mkdir /home/rensn/samba
- # chown rensn:rensn /home/rensn/samba
(3)共享文件夹
Java代码
- # mkdir /home/samba
- # chown nobody:nobody /home/samba
(4)设置
Java代码
- # cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
- # vi /etc/samba/smb.conf
- [global]
- unix charset = UTF-8 # <= Linux编码
- dos charset = CP932 # <= Windows编码
- display charset = UTF-8 # <= Linux编码
- smb ports = 139 # <= 端口
- workgroup = FUGA # <= Windows的Workgroup名
- hosts allow = 127. 192.168.21. # <= 只允许本地网路访问
- load printers = no # <= 不允许共享打印机
- disable spoolss = yes
- printing = bsd
- [homes]
- comment = Home Directories
- path = %H/samba # <= home文件夹路径/home/<user>/samba
- browseable = no
- writable = yes
- [public]
- comment = Public Stuff
- path = /home/samba
- public = yes
- writable = yes
- only guest = yes
(5)启动服务
Java代码
- # /etc/rc.d/init.d/smb start
- # /etc/rc.d/init.d/nmb start
(6)确认
从Windows系统访问后新建文件后
Java代码
- # ll /home/rensn/samba
(7)SWAT
安装
Java代码
- # yum -y install samba-swat
设置
- # vi /etc/xinetd.d/swat
- service swat
- {
- port = 901
- socket_type = stream
- wait = no
- only_from = 127.0.0.1 192.168.21.0/24
- user = root
- server = /usr/sbin/swat
- log_on_failure += USERID
- disable = yes
- }
确认
通过浏览器访问:https://<youripaddress>:901/
时间: 2024-10-06 07:44:00