ubuntu等linux系统给windows共享文件

安装

sudo apt-get install samba

修改配置添加共享目录 /home/whq

 sudo gedit /etc/samba/smb.conf &

添加

[ShareFiles]

comment = Shared Folder require password

path = /home/whq/

valid users = whq

available = yes

read only = no

browsable = yes

public = yes

writable = yes

设置用户和密码(注意要添加一个已有用户)

sudo smbpasswd -a whq

New SMB password:

Retype new SMB password:

Added user whq.

如果正式环境,最好创建一个不可以登录的专用用户操作。

创建专用用户

groupadd test -g 6000

useradd test -u 6000 -g 6000 -s /sbin/nologin -d /dev/null

这时就可以用smbpasswd -a test增加test这个samba账号了!为了增加系统的安全性,所以加的系统账号不要给shell它,也不给它指定目录,到时在/home目录给test账号建个文件夹,该文件夹只有test有读写权限即可!

如:

mkdir /home/test

chown -R test:test /home/test
发布了426 篇原创文章 · 获赞 33 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/whq12789/article/details/104052327