centos7.2
openstack环境为allinone 模式,这样跑代码好处理
安装smb
[root@controller ~]# yum install -y samba samba-client
建立新用户
[root@controller ~]# useradd myshare
设置smb密码
[root@controller ~]# smbpasswd -a myshare
New SMB password:
Retype new SMB password:
Mismatch - password unchanged.
Unable to get new password.
编辑文件,直接粘贴下面的也可以
[root@controller myshare]# egrep -v "^;|^#|^$|*#" /etc/samba/smb.conf
[global]
follow symlinks = yes
wide links = yes
unix extensions = no
workgroup = MYGROUP
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
load printers = no
cups options = raw
printcap name = /dev/null
printing = bsd
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
[myshare ]
comment = mysharefiles
path = /home/myshare
public = yes
writable = yes
browseable = yes
valid users = myshare
建立smb用户和系统用户对应关系
[root@controller ~]# cat /etc/samba/smbusers
myshare = myshare
重启服务
[root@controller ~]# systemctl restart smb
[root@controller ~]# systemctl enable smb
Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service.
windows就可以登录了
将需要的代码软连接到共享目录
[root@controller ~]# cd /home/myshare/
[root@controller myshare]# ls
[root@controller myshare]# ln -s /usr/lib/python2.7/site-packages/nova nova
[root@controller myshare]# ln -s /usr/lib/python2.7/site-packages/neutron neutro
加权限
[root@controller myshare]# ls
neutron nova
[root@controller myshare]# chmod -R 777 *
查看下权限没有问题的话就可以用
[root@controller myshare]# ll
total 0
lrwxrwxrwx 1 root root 40 Aug 28 07:37 neutron -> /usr/lib/python2.7/site-packages/neutron
lrwxrwxrwx 1 root root 37 Aug 28 07:29 nova -> /usr/lib/python2.7/site-packages/nova