samba安装配置,用户添加,密码设置

2 篇文章 0 订阅
1、ubuntu安装配置samba:

sudo apt-get install samba


2、一般情况下需要在/etc/samba/smd.conf文件使能共享文件:

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
[homes]
   comment = /home/wusc //被共享的目录
   browseable = yes //权限

3、添加账户
现在要添加newsfan这个网络访问帐户。
方式一、如果系统中当前没有这个帐户,那么:
sudo useradd newsfan
要注意,上面只是增加了newsfan这个用户,却没有给用户赋予本机登录密码。所以这个用户将只能从远程访问,不能从本机登录。而且samba的登录密码可以和本机登录密码不一样。
现在要新增网络使用者的帐号:
sudo smbpasswd -a newsfan

在这一部分会出现问题:
提示信息:
Failed to initialise SAM_ACCOUNT for user newsfan. Does this user exist in the UNIX password database ?
Failed to modify password entry for user newsfan
原因:
添加的用户newsfan必须是系统用户(系统->系统管理->用户和组->添加)

方式二、使用系统本身已有的账户登陆
sudo smbpasswd -a newsfan 
newsfan是你系统本身的用户

方式三,当然也可以去认真阅读一下/etc/samba/smb.conf配置文件,来添加用户,不过这样麻烦,上面用命令添加更方便

修改密码之后要重启samba服务器:

service smbd restart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值