samba安装与配置

samba

yum install -y samba samba-client    (安装Samba的客户端和服务)

mkdir /tmp/sambadir    (创建Samba的共享目录)

vim /etc/samba/smb.conf    (修改Samba配置文件)

    workgroup = WORKGROUP

    security = share

  [workspace]

    comment = share all

    path = /tmp/sambadir

    browseable = yes

    public = yes

    writeable = no

/etc/init.d/smb start    (启动Samba服务)

smbclient //192.168.111.129/workspace    (linux上连接Samba服务命令)

yum install -y cifs-utils    (安装Samba挂载包)

mount -t cifs //192.168.111.129/workspace /opt/    (将Samba目录挂载到opt文件夹下)

创建有用户名及密码的Samba

vim /etc/samba/smb.conf    (编辑配置文件)

    security = user

  [sharespace]

    comment = share for users

    path = /tmp/sambadir

    public = yes

    writeable = no

useradd smbuser1    (添加系统用户)

pdbedit -a smbuser1    (添加Samba用户)

/etc/init.d/smb restart        (重启服务) 

smbclient -Usmbuser1 //192.168.111.129/sharespace    (登陆Samba)

mount -t cifs -o username=smbuser1,password=evildragonfly23 //192.168.111.129/sharespace    (使用挂载的方法来挂载Samba目录到本机,并往相关文件夹内上传文件)


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章