samba

 

实现windows和linux的文件共享

 无密码共享(权限为只读)

yum install -y samba samba-client

 

Samba的配置文件为/etc/samba/smb.conf,通过修改这个配置文件来完成我们的各种需求

 

vim /etc/samba/smb.conf

 

 

[hy_share]
        comment = share all
        path = /tmp/test
        browseable = yes
        public = yes
        writable = no

 测试

mkdir /tmp/test/

chmod 777  !$

/etc/init.d/smb start

 

 
 
 
 

 

 

 


 

 

LINUX间的文件共享

 


 

通过挂载的方法实现文件共享

 yum install -y cifs-utils

 

 mount -t  cifs //192.168.145.6/hy_share /opt/

 

 cat /var/log/messages

 

 

 /etc/init.d/smb start

 

 mount -t  cifs //192.168.145.6/hy_share /opt/

 


 

有密码共享(权限为可读可写)

 

yum install -y samba samba-client

 

vim /etc/samba/smb.conf

 

 

 

[hy_share]
        comment = share for users
        path = /tmp/sambapass
        browseable = yes
        public = no
        writable = yes

 

创建smb用户

 useradd smbuser1

 pdbedit -a smbuser1

 

/etc/init.d/smb restart

 

 

posted @ 2015-09-25 15:06  沐风先生  阅读(151)  评论(0编辑  收藏  举报