LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: 北南南北

用vsFTPd自架Linux网络安装服务器[不断更新]

[复制链接]
发表于 2003-6-4 10:59:18 | 显示全部楼层
最初由 baipeboy 发表
在vsftpd.conf文件中有这样一个设置项不知道有什么用的,请指教~~

ls_recurse_enable=NO


若是启动此功能,则允许登入者使用ls -R 这个指令,默认值为NO。
 楼主| 发表于 2003-6-4 12:52:15 | 显示全部楼层
搞了一天也没搞好用PAM建虚拟用户。

我感觉我全是照版主说的那样做的,可是做完以后,发现连不上服务器了,给的提示是:
ftp: connect: Connection refused

自习检查了一遍,怀疑可能是一个地方有错
因为我开始的时候用的是:useradd dxdn 另建的一个用户,所以后来我用了
chown dxdn.dxdn /home/linuxsir006/hosts 这个命令,请版主看看是不是这里有毛病。


不要急,咱们还是测试一下再说。我感觉是hosts内容的事。
发表于 2003-6-4 13:25:40 | 显示全部楼层

vsftp怎样限制不同网段用户的登录?

不知vsftp中是否有这样的功能,就是对不同的目录设置不同的访问权限.
比如有个文件夹secret只能在192.168.1.0-255网段的用户可以访问.
而pub目录则可以公网访问.
谢谢.
发表于 2003-6-4 14:12:44 | 显示全部楼层
hosts的内容:
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.0.1        stealstar       

我怀疑是属主没设好,请问版主,我那样设对吗?
发表于 2003-6-4 19:24:53 | 显示全部楼层
5。把/etc/hosts复制到/home/linuxsir006,并改变它的属主

[root@linuxsir001 root]#cp /etc/hosts /home/linuxsir006/hosts

[root@linuxsir001 root]#chown linuxsir006.linuxsir006 /home/linuxsir006/hosts

请问北南前辈,这一步有什么作用。我在通过pam方式验证,建立虚拟用户的时候并没有用到这一步。
发表于 2003-6-5 12:34:20 | 显示全部楼层
老大,

      我的VSFTPD 服务器 别人的机器使用无法匿名登陆,连不上, 可用换成一般 用户就可以登录,怎么 回事?  在我的本机上匿名或一般用户都能访问,

我的匿名用户是默认的,在/var/pub下,我没有改过。

  以下是我的 匿名用户下的# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are very paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
#
# Allow anonymous FTP?
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=NO
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=NO
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=NO
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to  FTP service, download ONLY
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
发表于 2003-6-6 14:44:26 | 显示全部楼层
最初由 世纪之星 发表
太感谢了,解燃眉之急

其实不用这么复杂,我们可以修改/etc/passwd中关于ftp项的值,可以吧/var/ftp 修改成你需要的任何存在的目录呀!!
:beat
 楼主| 发表于 2003-6-6 15:22:27 | 显示全部楼层
    quote:最初由 世纪之星 发表
    太感谢了,解燃眉之急


其实不用这么复杂,我们可以修改/etc/passwd中关于ftp项的值,可以吧/var/ftp 修改成你需要的任何存在的目录呀!!


对。。

http://www.linuxsir.cn/forum.php?mod=viewthread&tid=10577

台兄最好能补充一点您的学习经验方面的,多谢。


sunberg兄,查看一下是否有nobody和ftp这个用户

[root@linuxsir001 root]# finger nobody
Login: nobody                           Name: (null)
Directory: /home/nobody                 Shell: /bin/bash
Never logged in.
No mail.
No Plan.
[root@linuxsir001 root]#
发表于 2003-6-7 00:44:48 | 显示全部楼层
不行了,我想把ftp目录改到/mnt/windows_f/ftpserver/ftp下,
[root@Seeall tool]# useradd -d /mnt/windows_f/ftpserver/ftp -g ftp -s /sbin/nologin ftp
useradd: unknown group ftp
而且因为在删ftp用户时少了个参数 -r
现在不能用ftp了

ftp> open 10.0.130.67
Connected to 10.0.130.67.
500 OOPS: vsftpd: cannot locate user specified in 'ftp_username'

现在该怎么办??
发表于 2003-6-7 16:07:40 | 显示全部楼层
beinan 老大你好

   我的FTP 和NOBODY 用户都在, 防火墙设置为默认容许FTP

   我的匿名 帐户就是不能上传和下载,但是都可以进入例如
:PASV

227 Entering Passive Mode (192,100,100,158,213,238)
RETR /pub/applysoft/antivirus/cehgx-lxoem.rar

550 Failed to open file.
Loading directory listing /pub/applysoft/antivirus from cache
PASV

227 Entering Passive Mode (192,100,100,158,219,235)
STOR /pub/applysoft/antivirus/amuseftp.log

550 Permission denied.
PASV

227 Entering Passive Mode (192,100,100,158,96,8)
LIST -aL

150 Here comes the directory listing.
226 Directory send OK.

          上面的一个是下载,另外一个是上传,

   下面是我的/etc/vsftpd.conf   反复开机重启VSFTPD也没有用啊?

   我看不出来问题出在哪里?  我已经 卸载重装过VSFTPD一次了,(是RPM的)
# Example config file /etc/vsftpd.conf
# The default compiled in settings are very paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
#
# Allow anonymous FTP?
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=NO
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to  blah FTP service DOWNLOAD ONLY  .
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表