Install Samba Server on Ubuntu

[url]http://www.howtogeek.com/howto/ubuntu/install-samba-server-on-ubuntu/[/url]


If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.


To install, first open a terminal window and enter the following command:

sudo apt-get install samba smbfs

We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:

sudo gedit /etc/samba/smb.conf

Find this section in the file:

####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user

Uncomment the security line, and add another line to make it look like this:

security = user
username map = /etc/samba/smbusers

This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User

There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a <username>

Next, we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

<username> = “<username>”

Now you can create samba shares and give access to the users that you listed here


ps : you should check the "selinux" config , or there maybe "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" error


from: http://hi.baidu.com/51cmdshell/blog/item/ee1114ae43b014c77cd92ac6.html

Ubuntu Samba服务安装与配置
2010年02月17日 星期三 12:14

一. Ubuntu samba配置的安装:

sudo apt-get install samba smbfs smbclient

二. 创建共享目录:

mkdir /home/komy/share
sodu chmod 777 /home/komy/share

三. 创建Ubuntu Samba配置文件:

1. 保存现有的配置文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
2. 修改现配置文件
sudo gedit /etc/samba/smb.conf
在smb.conf最后添加
[share]
path = /home/komy/share
available = yes
browsealbe = yes
public = yes
writable = yes

其实,更为简单的是在ubuntu下右击文件夹属性,在共享里设置共享,但实质上系统更改了smb.conf文件.

四. 创建Ubuntu samba帐户

sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a komy #komy必须为系统中存在的账户

然后会要求你输入samba帐户的密码

如果没有第四步,当你登录时会提示 session setup failed: NT_STATUS_LOGON_FAILURE]

五. 重启Ubuntu samba服务器

sudo /etc/init.d/smbd restart

六. Ubuntu Samba配置测试

smbclient //localhost/share

七,Ubuntu Samba配置使用

可以到windows下输入ip使用了,在文件夹处输入 "\\" + "Ubuntu机器的ip或主机名" + "\\" + "share"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值