安装samba
yum install -y samba samba-client vim /etc/samba/smb.conf
(共享一个目录,任何人都可以访问但不能写修改)
workgroup = WORKGROUP security = share [chao] comment = share all path = /tmp/sambadir browseable = yes writable = no public = yes
保存后启动
/etc/init.d/sam start mkdir /tmp/sambadir cp /etc/passwd /tmp/sambadir/1.txt mkdir /tmp/sambadir/test chmod 777 /tmp/sambadir/test
在windows中用cmd命令框 输入\192.168.1.103chao 就可以查看共享文件
(共享一个目录,需要用户密码登陆,具有读写权限)
vim /etc/samba/smb.conf workgroup = WORKGROUP security = user [chaolinux] comment = share for users path = /tmp/sambadir123 browseable = yes writable = yes public = no
保存后创建用户
useradd smbuser1 pdbedit -a smbuser1(输入密码) /etc/init.d/smb restart mkdir /tmp/sambadir123 cp /etc/passwd /tmp/sambadir123/1.txt mkdir /tmp/sambadir123/test chmod 777 /tmp/sambadir123/test
在windows中用cmd命令框 输入\192.168.1.103chaolinux 弹出用户登录窗口,输入用户和密码后,就进入了共享目录,可以在test下进行读写修改创建。