惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Attack and Defense Labs
Attack and Defense Labs
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
O
OpenAI News
L
LINUX DO - 最新话题
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
T
Tor Project blog
博客园_首页
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
S
Secure Thoughts
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Visual Studio Blog
J
Java Code Geeks
Cisco Talos Blog
Cisco Talos Blog
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security Affairs
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
宝玉的分享
宝玉的分享
量子位
Last Week in AI
Last Week in AI
月光博客
月光博客
罗磊的独立博客
S
SegmentFault 最新的问题

博客园 - SweetDream

如何使用SecureCRT连接ubuntu (转) VC++中的char,wchar_t,TCHAR(转载) 【转】Linux内核学习笔记(5)连载---实模式、保护模式和虚拟8086方式 concept 计算机英语 C++备忘录(记录一些不常使用的语法规则) Effective STL 笔记 <容器> VS2005 快捷键 网摘 君心莫邪 迭代器(iterators) 空间配置器(allocator) 函数返回引用或指针的选择 【转】最节省时间的方法——学习 C++数据类型速查 Cegui的事件机制 C++不定参数 Lua 与 C 交互(2) Lua 与 C 交互(1)
转 linux共享
SweetDream · 2011-04-27 · via 博客园 - SweetDream

安装samba:

sudo apt-get install samba

sudo apt-get install smbfs

下面我们来共享群组可读写文件夹,假设你要共享的文件夹为: /home/ray/share

首先创建这个文件夹

mkdir /home/ray/share

chmod 777 /home/ray/share

备份并编辑smb.conf允许网络用户访问

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup

sudo gedit /etc/samba/smb.conf

搜寻这一行文字

;security = user

用下面这几行取代

security = user

username map = /etc/samba/smbusers

若要使用用户可以匿名访问到,用下面这一行取代:

security = share

将下列几行新增到文件的最后面,假设允许访问的用户为:youuser。而文件夹的共享名为 Share

[Share]

comment = Shared Folder with username and password

path = /home/ray/share

public = yes

writable = yes

valid users = youuser

create mask = 0700

directory mask = 0700

force user = nobody

force group = nogroup

available = yes

browseable = yes

然后顺便把这里改一下,找到[global]把 workgroup = MSHOME 改成

workgroup = WORKGROUP

display charset = UTF-8

unix charset = UTF-8

dos charset = cp936

后面的三行是为了防止出现中文目录乱码的情况。其中根据你的local,UTF-8 有可能需要改成 cp936。自己看着办吧。

现在要添加youuser这个网络访问帐户。如果系统中当前没有这个帐户,那么

sudo useradd youuser

要注意,上面只是增加了youuser这个用户,却没有给用户赋予本机登录密码。所以这个用户将只能从远程访问,不能从本机登录。而且samba的登录密码可以和本机登录密码不一样。

现在要新增网络使用者的帐号:

sudo smbpasswd -a youuser

sudo gedit /etc/samba/smbusers

在新建立的文件内加入下面这一行并保存

youuser = “network username”

如果将来需要更改youuser的网络访问密码,也用这个命令更改

sudo smbpasswd -a youuser

删除网络使用者的帐号的命令把上面的 -a 改成 -x

sudo testparm

sudo /etc/init.d/samba restart

重启下samba服务。

windows 输入你的ip输入用户名和密码就能访问了。