vsftp使用及注意事项

| |
[不指定 2009/11/24 22:44 | by 挥舞尘埃 ]
1.1vsFTPd服务器的运行;
/usr/sbin/vsftpd &
/usr/local/sbin/vsftpd &

vsFTPd服务器是否运行起来;
我们可以通过pgrep vsftpd 来查看vsftpd是否运行起来;
pgrep vsftpd
4248

上面显示vsFTPd服务器运行起来了,您可以通过ftp命令、lftp工具或gftp或其它的FTP客户端来测试连接;
1.2.1vsFTPd 服务器关闭:
我们用pkill vsftpd 来杀死vsftpd进程,这样就把vsFTPd关闭,用psgrep vsftpd 来查看进程,如果没有进程,证明vsFTPd已经关掉;当然也要用到root权限。
pkill vsftpd
pgrep vsftpd

1.2.2 在Fedora/Redhat/CentOS中vsFTPd 服务器的启动和关闭:
在Fedora/Redhat/CentOS中,也可以用下面的方法来启动vsFTPd;当然也要用到root权限;
/etc/init.d/vsftpd start
为 vsftpd 启动 vsftpd:                                    [  确定  ]

重新启动vsFTPd用下面的命令;
/etc/init.d/vsftpd restart
关闭 vsftpd:                                              [  确定  ]
为 vsftpd 启动 vsftpd:                                    [  确定  ]

关掉vsFTPd服务器,应该用下面的命令;
/etc/init.d/vsftpd stop
关闭 vsftpd:                                              [  确定  ]


2.1关于添加本地用户及打开读写权限示例;

FTP用户一般是不能登录系统的,这也是为了安全。在系统中,没有权限登录系统的用户一般也被称之为虚拟用户;虚拟用户也是要写进/etc/passwd中;这只是一种虚拟用户的方法,但说实在的并不是真正的虚拟用户,只是把他登录SHELL的权限去掉了,所以他没有能力登录系统;

如果我们想把beinan这个用户目录定位在/opt/beinan这个目录中,并且不能登录系统;我们应该如下操作

[root@localhost ~]# adduser -d /opt/beinan -g ftp -s /sbin/nologin beinan
[root@localhost ~]# passwd beinan
Changing password for user beinan.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#

其实这还是不够的,还要改一下配置文件vsftpd.conf ,以确保本地虚拟用户能有读写权限;
local_enable=YES
write_enable=YES
local_umask=022

3. 如何实现虚拟路径?
比如:
/home/a 映射为 ftp://localhost/a
/home/b/c 则为 ftp://localhost/c
其实这个不能说是vsFTPd的内容,其实我们早就接触过了,可能我们没有注意,我们可以通过如下的方法来实现。
[root@localhost ~]# mount --bind [原有的目录] [新目录]
比如我的ftp的默认目录是/var/ftp,我想把/mnt/LinG/WinSoft文件夹,映射到/var/ftp目录中,我就如下操作
我们要先在/var/ftp目录中建一个目录

[root@localhost ~]# mkdir /var/ftp/WinSoft

然后执行mount命令

[root@localhost ~]# mount --bind /mnt/LinG/WinSoft /var/ftp/WinSoft

4.
500错误的解决方法:

修改文件夹权限:
chmod 777 /home/wmzhi
修改文件夹属主:
chown wmzhi /home/wmzhi/www
然后重启VSFTPD:
/etc/init.d/vsftpd restart

5.vsftpd的安装
[root@localhost ~]# yum install vsftpd

[root@localhost ~]# tar zxvf vsftpd-2.0.3.tar.gz
[root@localhost ~]# cd vsftpd-2.0.3
[root@localhost ~]# make ;make install
[root@localhost ~]# cp vsftpd.conf /etc


6
#anonymous_enable=YES
local_enable=YES
write_enable=YES
pam_service_name=vsftpd
userlist_enable=YES

check /etc/vsftpd/user_list and /etc/ftpusers

Web Server | 评论(9) | 引用(0) | 阅读(1146)
Discount Oakley Sunglasses Email Homepage
2012/05/18 16:22
This is really my very first time here, great looking blog.
Ugg boots sale Email Homepage
2011/09/30 15:09
However, in mordern society,  this shows up has changed.
michel Email
2011/07/14 10:53
mdsgehe Email
2011/07/09 15:55
We do like to keep a close on supra sneakers to ensure you guys are first to see any new releases, news and updates from the extremely popular brand.
sard Email
2011/07/04 11:36
Our rolex replica watches give you such a chance to maintain a close touch with original Rolex watches.
resume Email Homepage
2011/06/30 14:54
该脚本是正确的。这是可能的改善到底,但这样也可以。
mdsa Email
2011/06/22 13:50
Abercrombie & Fitch comfort as well as satisfaction is the priority of Abercrombie Fitch Outlet which everybody welcomes.
gatem Email
2011/05/20 14:05
A close-up of the feathery bodice on a look at the ann demeulemeester fall 2011 collection, shown today in Paris.
sdsare Email
2011/05/18 09:54
With enthusiasts a over the globe, Chelsea FC offers sports lovers as well as the image conscious a look Cheap MLB Jerseys wholesalers can tell you is well-known correct now.
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]