当前位置:   article > 正文

Samba服务安装_samba panic action

samba panic action
Samba服务(共享文件)
一,安装1)  apt-get install samba2)  apt-get install samba-common3)apt-get install cifs-utils
二,创建共享文件夹在home目录下创建文件夹Mkdir/home/share
三,修改文件的权限
Chmod 777   /home/share


四,输入"sudo smbpasswd -a smbuser"(如果添加的用户系统用户不存在则先sudo useradd smbuser)
-->回车-->输入两次密码-->回车-->密码设置成功,
这个用户属于smb组
这里讲解下参数 -a 增加用户,用户必须是系统已创建的用户这样才能加入到samba中去
-d  冻结用户,就是这个用户不能再登陆samba中去了-e  恢复用户,解冻用户,让冻结用户可以使用
五,修改配置文件
vim /etc/samba/smb.conf
如下:
[global]




   workgroup = WORKGROUP


server string = %h server (Samba, Ubuntu)




;   wins server = w.x.y.z


   dns proxy = no




;   interfaces = 127.0.0.0/8 eth0


;   bind interfaces only = yes








   log file = /var/log/samba/log.%m


   max log size = 1000




   syslog = 0


   panic action = /usr/share/samba/panic-action %d






   server role = standalone server


   passdb backend = tdbsam


   obey pam restrictions = yes


   unix password sync = yes


   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .


   pam password change = yes


   map to guest = bad user






;   logon path = \\%N\profiles\%U


;   logon drive = H:


;   logon script = logon.cmd


; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u


; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u


; add group script = /usr/sbin/addgroup --force-badname %g




;   include = /home/samba/etc/smb.conf.%m


;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash




;   usershare max shares = 100


   usershare allow guests = yes




;[homes]
;   comment = Home Directories
;   browseable = no


;   read only = yes


;   create mask = 0700


;   directory mask = 0700


;   valid users = %S


;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes


;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700




;   write list = root, @lpadmin


[workspace]
   comment = Printer Drivers
   path = /home/share
   browseable = yes
   writable = yes
   public = no
   guest ok = no


六,关闭防火墙或者开放端口号(可跳过)关闭防火墙Ufwdisable 开放端口号  Ufw allow 137/udpUfw allow 138/udp  Ufw allow 139/udp  Ufw allow 445/udp


7、输入"sudo service smbd restart"重启samba服务-->回车-->服务重启成功。

八、连接在window下打开文件\\192.168.187.144输入ubuntu的ip地址,进行连接就行了,这就是我所创建的共享文件夹
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/182471?site
推荐阅读
相关标签
  

闽ICP备14008679号