3月 232011
 

HOWTO : Home made NAS server with Ubuntu 8.04.1 – Part II
[HOWTO] 用Ubuntu 8.04.1搭建NAS服务器 – Part II

Here comes the software installation. The first thing is to install the operating system – Ubuntu 8.04.1 Server Edition. The installation is quite straight forward and you should choose LAMP, OpenSSH and Samba (Print server is optional) during the installation. Use a more complicate but easy to remember password as the user password and MySQL password. I use same password for them. Please write it down and you will need it later and forever.
这里是软件的安装。首先是安装操作系统Ubuntu 8.04.1 Server Edition。安装过程中,选择LAMP, OpenSSH and Samba(Print服务可选)。为操作系统用户和MySQL用户设定足够复杂又容易记住的口令。我使用了相同的口令。请写下来,过一会儿就要使用,而且永远要使用。

Once installed, you can install vsFTPd and Fail2Ban. BitTorrent feature will be discuss later.
下一步,安装vsFTPd和Fail2Ban。BT后面再说。

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vsftpd fail2ban

Samba

The Samba is already installed and you are required to configure it to make it work. I will make the Samba working in this way : Every user has it owned home directory and every user can access to a public directory for sharing document and files.
Samba已经安装结束,你需要完成配置使它工作。我设计的Samba规则如下:每个用户有自己的私有目录,每个用户都可以访问共享文件的公共目录。

sudo nano /etc/samba/smb.conf

To add the following lines to the [global] section :
在[global]段,加入以下几行:

# If you need to access Big5 filename, it is required; otherwise it is optional.
#dos charset = cp950
dos charset = UTF-8
#dos charset = cp936

To add the following lines to the [global] section also :
在[global]段,再加入以下几行:

hosts allow = 127.0.0.1 192.168.0.0/24 192.168.10.0/24
hosts deny = 0.0.0.0/0

At Authentication part, uncomment the “# security = user” to read as “security = user”
在认证部分,去掉注释“# security = user”,变成“security = user”。

Go to [homes] section and add the following lines to it :
在[homes]段,加入以下几行:

[homes]
comment = Home Directories
path = /home/%S
browseable = yes
read only = no
create mask = 0664
directory mask = 0664
valid users = %S

Add the following lines to the end of the file :
文件最后加入以下几行:
[public]
comment = Share to all
path = /home/public
browseable = yes
read only = no
create mask = 0664
directory mask = 0664
valid users = samiux,john,mary
admin users = samiux

To reload the configuration of your Samba server :
重启Samba服务器。

sudo /etc/init.d/samba reload

where “admin users = samiux”may be different from you.
其中“admin users = samiux”部分,你自己的设置应该不一样的。

Then made a “public” directory at /home :
在/home下,创建“public”目录:

sudo mkdir /home/public
chgrp users /home/public
chmod 0777 -R /home/public

Now, create normal users as Samba users. Only the users exist in the server can use the Samba.
现在为Samba用户创建系统普通用户,只有服务器的用户才能使用Samba。

sudo adduser john
sudo adduser mary

You can access the Samba at Windows system in this way :
在Windows系统中访问Samba的方法:

Go to your home directory :
进入你的私有目录:
\\192.168.0.15\samiux

Go to the public directory :
进入公共目录:
\\192.168.0.15\public

* your IP address may be different from me
* 你的IP地址应该有所不同

Beware that all home user directories and public directory are writable. Users can add or delete files therein. The home directory owners cannot read and writable another home user directories.
要注意的是,所有的私有目录和公共目录都是可写的。用户可以创建和删除文件。用户不能读写其他用户的私有目录。

By the way, you can also access the Samba file server on your Ubuntu desktop.
另外,你也可以使用Ubuntu desktop访问Samba服务器。

We will discuss how to configure vsFTPd in next part.
下一部分我们会说一下如何配置vsFTPd。

 回复

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>