• 搭建samba 共享openstack开发环境


    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

     

     

  • 相关阅读:
    Jpa 一对多级联查询 排序设置
    Spring Data Jpa Specification 调用Oracle 函数/方法
    Spring boot 集成 阿里 Mqtt
    将Jquery序列化后的表单值转换成Json
    Linux安装和卸载MySQL5.7
    NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{3bFuKD5MTOWOCfJ1ZFrfdw}{192.168.0.105}{192.168.0.105:9301}]]
    Docker下安装RabbitMQ
    JAVA数据结构与算法-稀疏数组
    第一篇博客
    测试用例编写方法:边界值分析方法
  • 原文地址:https://www.cnblogs.com/menkeyi/p/5823677.html
Copyright © 2020-2023  润新知