阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

openSUSE 13.2/13.1 下安装配置 FTP服务器 vsftpd

132次阅读
没有评论

共计 3166 个字符,预计需要花费 8 分钟才能阅读完成。

这篇指导描述如何使用 vsftpd 在 openSUSE 13.2/13.1 里建立并配置一个简单基本的 FTP 服务器。vbftpd 是一个适合 Unix/Linux 系统的安全快速的 FTP 服务。

1. 建立 vsftpd

使用命令以 root 用户登录
su

接着输入对 vsftpd 包的命令
zypper in vsftpd

启动 vsftpd 服务并设置开机自启
systemct1 enable vsftpd
systemct1 start vsftpd

2. 配置 vsftpd

创建一个用户文件夹
mkdir /srv/ftp

创建一个名为 ftp-users 的组
groupadd ftp-users

在目录 /srv/ftp 下创建一个名为 Unixmen 的用户
useradd -g ftp-users -d /srv/ftp/ Unixmen

设置口令
passwd Unixmen

使 ftp 主目录 /srv/ftp/ 可被用户访问
chomd 750 /srv/ftp/
chown Unixmen:ftp-users /srv/ftp/

修改如下所示:
[…]
# Uncomment and  Set YES to enable write.
write_enable=YES
[…]
# Uncomment and Set banner name for your website
ftpd_banner=Welcome to Unixmen FTP service.
[…]
# Uncomment
ls_recurse_enable=YES
[…]
# Uncomment and set YES to allow local users to log in.
local_enable=YES
[…]
# To disable anonymous access, set NO.
anonymous_enable=NO
[…]
# Uncomment to enable ascii download and upload.
ascii_upload_enable=YES
ascii_download_enable=YES
[…]
## Add at the end of this  file ##
use_localtime=YES

保存并退出

3. 在本地主机中测试 ftp 服务器

首先登陆它,如下所示
ftp localhost

会有如下输出

Trying ::1:21 …
Connected to localhost.
220 (vsFTPd 3.0.2)
Name (localhost:skopensuse): unixmen  ## FTP user name
331 Please specify the password.
Password:  ## FTP user password
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

你的输出如上的话,我们就能使用 Unixmen 用户登录了。quit 退出 ftp 控制台。

4. 从一个远程主机测试服务器

默认情况下,openSUSE 内置的防火墙不允许远程系统登陆 ftp。因此要使 vsftpd 服务
能够通过它的防火墙。这样做:Yast -> Security and Users -> Firewall.

openSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpd

在防火墙选项里,选到 Allowed Services,在选择下拉框里选择 External Zone 并在
Service 允许下拉框,选择 vsftpd server 并点击添加 add。

openSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpd

点击下一步,关闭 Yast 控制中心。

现在试着从一个远程系统连接。就我来说,我使用我的 Ubuntu 桌面系统。
ftp 192.168.1.150
输出样例
Connected to 192.168.1.150.
220 (vsFTPd 3.0.2)
Name (192.168.1.150:sk): unixmen
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

你的输出如上的话,就能连接 FTP 服务器了。如果你没有允许 vsftpd 通过
防火墙,将可能有 Connect timed out 连接超时的错误。

5. 使用浏览器连接
打开浏览器并转到 ftp://ip-address/. 输入用户名及密码

openSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpd

openSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpd

6. 使用 filezilla 连接到 ftp 服务器
对菜鸟来说在命令提示符下工作可能会不太耐烦,那就建立一个叫 filezilla
的图形化 FTP 客户端来让事情变得简单。
通常,filezilla 可以在几乎说有 Linux 发行版的默认存储库里找到
在 Ubuntu 基础版里
sudo apt-get install filezilla

在 Fedora/RedHat 系统里
sudo yum install filezilla

在 openSUSE 里
zypper in filezilla

安装 filezilla 后,打开并输入 FTP 服务器的 IP 地址,用户名和密码并点击 quickconnect

openSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpdopenSUSE 13.2/13.1 下安装配置 FTP 服务器 vsftpd

为了增加安全性,你可以通过将用户添加到 /etc/vsftpd.chroot_list file 中来
限制具体的用户访问 FTP。
编辑如下
nano /etc/vsftpd.conf
修改如下
[…]
# Uncomment and set YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
[…]

创建新文件 /etc/vsftpd.chroot_list
nano /etc/vsftpd.chroot_list

添加你允许访问 FTP 服务器的用户。我添加的是 Unixmen
Unixmen

重启 FTP 服务器
systemctl restart vsftpd

现在你可以试着使用在 chroot 列表文件里的用户登录了,可能会有如下错误
500 OOPS: could not read chroot() list file:/etc/vsftpd.chroot_list
ftp: Login failed

就是这样的,你的 FTP 服务器可以使用了。

在 openSUSE 13.1 中配置 FTP 服务器  http://www.linuxidc.com/Linux/2014-01/94645.htm

玩转 vsftpd 服务器的四大高级配置:http://www.linuxidc.com/Linux/2013-09/90565.htm

vsFTPd 配置教程:http://www.linuxidc.com/Linux/2013-09/90562.htm

Ubuntu 实用简单的 FTP 架设 http://www.linuxidc.com/Linux/2012-02/55346.htm

Ubuntu 上架设 FTP 服务器和 Apache 服务器 http://www.linuxidc.com/Linux/2011-04/35295.htm

Ubuntu 13.04 安装 LAMP\vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm

RHEL6 平台下 SeLinux 和 vsftpd 的匿名上传的简单案例 http://www.linuxidc.com/Linux/2013-04/82300.htm

Linux 系统 vsftpd 源码安装 http://www.linuxidc.com/Linux/2013-03/81475.htm

英文原文:How To Setup FTP Server On openSUSE 13.2/13.1

译者:暗

本文由 Linux 公社翻译组 原创翻译  Linux 公社推出

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-12/110070.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计3166字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中