使用samba初始化开发环境

一、系统环境

[root@host-172-20-3-66 samba]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

搞一个yum源吧,我搞的是本地源,其他的可以使用阿里yun的

[root@host-172-20-3-66 samba]# cat /etc/yum.repos.d/openstack-mitaka.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://172.20.1.10/openstack/base
enabled=1
gpgcheck=0 [mitaka]
name=mitaka
baseurl=http://172.20.1.10/openstack/openstack-mitaka
enabled=1
gpgcheck=0 [epel]
name=epel
baseurl=http://172.20.1.10/openstack/epel
enabled=1
gpgcheck=0

二、开始装吧

yum -y install samba samba-client
cd /etc/samba/
mv smb.conf smb.conf.origin cat >> /etc/samba/smb.conf << EOF
[global]
workgroup = WORKGROUP
server string = Ted Samba Server %v
netbios name = TedSamba
security = user
map to guest = Bad User
passdb backend = tdbsam [FileShare]
comment = share some files
path = /smb/fileshare
public = yes
writeable = yes
create mask = 0644
directory mask = 0755 [devops]
comment = project development directory
path = /smb/devops
valid users = wanstack
write list = wanstack
printable = no
create mask = 0666
directory mask = 0777 EOF groupadd wanstack
useradd wanstack -g wanstack -s /sbin/nologin
echo wanstack | passwd --stdin wanstack
mkdir -p /smb/{fileshare,devops}
chown nobody:nobody /smb/fileshare/
chown wanstack:wanstack /smb/webdev/
smbpasswd -a wanstack     # 配置samba账号
systemctl start smb systemctl enable smb

装好了,简单吧。

\\172.20.3.66  试试看吧。

上一篇:git 详细教程和常用操作指令


下一篇:201521123071 《JAVA程序设计》第十二周学习总结