标签:art nbsp enforce disable netbios 文件 connect rman yum
之前给自己centos 服务器配置了一下samba网络共享,主要是在windwos上编程,然后方便代码同步到linux上进行编译,现在大概记录一下过程,免得下次又忘记了
首先获取root权限 :su root
1.安装
# yum install samba samba-client -y
2、设置开机启动
# systemctl enable smb.service
3. 启动samba服务
# systemctl start smb.service
4. 查看samba服务状态
1 [root@yejy /]# systemctl status smb.service 2 ● smb.service - Samba SMB Daemon 3 Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled) 4 Active: active (running) since 日 2018-07-15 23:08:51 CST; 16min ago 5 Main PID: 4030 (smbd) 6 Status: "smbd: ready to serve connections..." 7 CGroup: /system.slice/smb.service 8 ├─4030 /usr/sbin/smbd --foreground --no-process-group 9 ├─4032 /usr/sbin/smbd --foreground --no-process-group 10 ├─4033 /usr/sbin/smbd --foreground --no-process-group 11 ├─4036 /usr/sbin/smbd --foreground --no-process-group 12 └─4154 /usr/sbin/smbd --foreground --no-process-group
5. 配置相关配置文件
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak //备份配置文件
# >smb.conf //清空配置文件
# vim smb.conf
配置内容如下:
1 [global] 2 workgroup = WORKGROUP 3 server string = Samba Server %v 4 netbios name = centos 5 security = user 6 map to guest = bad user 7 dns proxy = no 8 #============================ Share Definitions ============================== 9 [myshare] 10 commont = Share Directories 11 path = /home/willy/myshare 12 available = yes 13 valid users = willy 14 browseable = yes 15 writable = yes 16 public = yes 17 create mask = 0644 18 directory mask = 0777 19 vaild users = willy 20 force user = willy 21 force group = willy 22 read only = No 23 ~ 24 ~ 25 ~ 26 ~ 27 ~ 28 ~ 29 ~ 30 ~ 31 ~ 32 ~ 33 ~ 34 "/etc/samba/smb.conf" 22L, 484C
6. 添加用户(可能会涉及到修改用户文件权限)
# smbpasswd -a willy
7. 防火墙配置和SELinux设置
a. SELinux设置
临时关闭:
# setenforce 0
修改配置文件关闭:
# vi /etc/sysconfig/selinux
SELINUX=disabled
b. 防火墙设置
# firewall-cmd --permanent --zone=public --add-service=samba
# firewall-cmd --reload
8. 重启samba服务
# systemctl restart smb.service
9. windows端登录ip
win+R
ip为Linux服务器的ip,ifconfig -a可以查看
标签:art nbsp enforce disable netbios 文件 connect rman yum
原文地址:https://www.cnblogs.com/blog-yejy/p/9315652.html