系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
-
联系:
#76
帖子
由 vickycq » 2016-01-24 17:03
montana 写了:
$ aptitude why-not php5-mysql
i phpmyadmin Depends php5-mysql | php5-mysqli | php5-mysqlnd | php7.0-mysql
p php5-mysqlnd Conflicts php5-mysql
显示的是这个结果,不理解是什么意思。
貌似你已经安装了 php5-mysqlnd?那可以不安装 php5-mysql
再确认一下:
sudo apt-get install php5-mysqlnd
sudo apt-get purge php5-mysql
事实上,mysql-client安装以后,似乎就自动安装上php5-mysql了,或者安装phpmyadmin的时候就已经安装好了。
看来冲突解决了?之前是什么问题还没搞清楚
发现取消enable wifi后,就直接没有wlp2s0信息显示了。
这是自然,这样相当于把无线网卡 soft block 了。用 rfkill list all 可看到情况
我是看到你无线网卡也连接了热点,分配了 ip 地址
上次由
vickycq 在 2016-01-24 19:19,总共编辑 1 次。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#77
帖子
由 montana » 2016-01-24 17:25
“看来冲突解决了?之前是什么问题还没搞清楚 ”
隐约觉得,之前安装 phpmyadmin的时候就一起安装了。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#78
帖子
由 montana » 2016-01-24 17:51
在目前的配置下,本机ubuntu浏览器上可以访问192.168.1.8或者localhost。在其他windows 7电脑上,用控制台可以ping的通192.168.1.8,时间均小于1ms,可是浏览器却无法浏览该地址。百度了一下“如何局域网里访问ubuntu lamp服务器”,也没找到有用的信息。猜测是不是要开防火墙?百度上提到了修改httpd.conf端口的问题,可是本地机etc目录下根本找不到这个文件。
http://blog.csdn.net/xin_yu_xin/article ... s/44871577
安装这里的方法修改了端口,最后一步没有找到httpd.conf,就直接修改了apache2,最下面添加了Servername localhost。本机到可以访问http://192.168.1.8:9000/index.html了,同局域网的机器还是无法访问。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#80
帖子
由 montana » 2016-01-24 19:54
vickycq兄真乃神人也。感谢感谢!
http://askubuntu.com/questions/339308/u ... ble-on-lan
从这里得到解决方法,添加了一条防火墙规则:
montana@L440:~$ sudo ufw allow from 192.168.1.0/24 to any port 80
现在显示的是:
montana@L440:~$ sudo ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] 80 ALLOW IN 192.168.1.0/24
一切正常,局域网可以正常访问了。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#81
帖子
由 montana » 2016-01-24 20:12
apache2.conf配置如下:
代码: 全选
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., http://www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
#<Directory /var/www/>
<Directory /home/montana/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Include /etc/phpmyadmin/apache.conf
上次由
montana 在 2016-01-24 20:23,总共编辑 1 次。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#82
帖子
由 montana » 2016-01-24 20:14
sites-enabled中的000-default.conf配置如下:
代码: 全选
<VirtualHost 0.0.0.0:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName http://www.example.com
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
DocumentRoot /home/montana/www
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#83
帖子
由 montana » 2016-01-24 23:46
为帮助后来的兄弟,这里mark一下。
http://jingyan.baidu.com/article/7908e8 ... ad2ae.html
http://jingyan.baidu.com/article/67508e ... ce470.html
http://www.cnblogs.com/CSGrandeur/p/3754126.html
我的vsftpd.conf配置如下:
代码: 全选
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=NO
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# 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
#
# If enabled, vsftpd will display directory listings with the time
# in your local time zone. The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=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.
# Note that the default log file location is /var/log/xferlog in this case.
#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 on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to Michael's FTP service.
#
# 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 restrict local users to their home directories. See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# 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().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
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
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty. Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=ftp
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES
local_root=/home/montana/www
pasv_promiscuous=YES
按照上面三个例子搭建了ftp服务,建立了新用户,设置了密码。本机可以登录,可是无法在局域网里其他机器登录,添加一条防火墙规则,成功登录。
代码: 全选
montana@L440:~$ sudo ufw allow from 192.168.1.0/24 to any port 21
Rule added
montana@L440:~$ sudo ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] 80 ALLOW IN 192.168.1.0/24
[ 2] 21 ALLOW IN 192.168.1.0/24
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#84
帖子
由 montana » 2016-01-25 0:03
代码: 全选
# Uncomment this to enable any form of FTP write command.
write_enable=YES
虽然我这里取消了注释,可是用flashfxp上传的时候,却始终上传失败,下载一切正常,不知道是何原因?显示正在打开数据链接IP 192.168.1.8 端口:61409,然后就是传输失败提示。
上次由
montana 在 2016-01-25 9:36,总共编辑 1 次。
-
vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
-
联系:
#85
帖子
由 vickycq » 2016-01-25 0:31
montana 写了:显示正在打开数据链接IP 192.168.1.8 端口:61409,然后就是传输失败提示。
传输失败的提示是什么,553 无法创建文件?
首先排除权限问题,用 Ubuntu 系统用户 "montana" 登录(local_enable=YES),上传文件到自己的家目录 /home/montana/
查看 vsftpd 的日志 /var/log/vsftpd.log,寻找上传错误信息
如果没有此日志文件,可能需要在配置文件中启用日志。方法参考
https://www.centos.org/docs/5/html/5.2/ ... t-log.html
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#86
帖子
由 montana » 2016-01-25 9:42
代码: 全选
Sun Jan 24 23:56:20 2016 [pid 9258] [michael] OK LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:24 2016 [pid 9268] CONNECT: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:26 2016 [pid 9267] [anonymous] FAIL LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:27 2016 [pid 9272] CONNECT: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:27 2016 [pid 9270] [michael] OK LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:36 2016 [pid 9285] CONNECT: Client "::ffff:192.168.1.2"
Sun Jan 24 23:56:36 2016 [pid 9284] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Sun Jan 24 23:56:40 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:57:06 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:58:25 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:59:10 2016 [pid 9314] CONNECT: Client "::ffff:192.168.1.2"
Sun Jan 24 23:59:10 2016 [pid 9313] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Sun Jan 24 23:59:17 2016 [pid 9317] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Mon Jan 25 00:00:07 2016 [pid 9333] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:09 2016 [pid 9332] [anonymous] FAIL LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:11 2016 [pid 9337] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:12 2016 [pid 9335] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 09:33:36 2016 [pid 2093] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:36 2016 [pid 2092] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:42 2016 [pid 2097] [michael] OK DOWNLOAD: Client "::ffff:192.168.1.2", "/index.html", 57 bytes, 0.53Kbyte/sec
Mon Jan 25 09:33:56 2016 [pid 2141] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:56 2016 [pid 2139] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:34:10 2016 [pid 2144] [michael] OK DOWNLOAD: Client "::ffff:192.168.1.2", "/index.html", 57 bytes, 88.92Kbyte/sec
Mon Jan 25 09:39:00 2016 [pid 2144] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
上传失败,提示信息如此,下载一切正常。英语不过关,看英文网页头大,呵呵。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#87
帖子
由 montana » 2016-01-25 9:47
猜测是不是要设置一个允许的allow out端口啊?可是每次flashfxp登录的时候,端口都不一样,比如:58636,59345什么的,每次都在变。
-
vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
-
联系:
#88
帖子
由 vickycq » 2016-01-25 10:01
貌似你这个日志内容不够全,在 'FAIL UPLOAD: Client' 之前还应该有其它信息,如 '425 Failed to establish connection.' 或 '553 Could not create file.'
尝试在 vsftpd 配置文件中加入
代码: 全选
dual_log_enable=YES
xferlog_enable=YES #已经添加
log_ftp_protocol=YES
xferlog_std_format=NO
xferlog_file=/var/log/xferlog
以上的目的是在日志中记录更多连接信息,但不能保证100%有效。因为逻辑比较复杂,具体参考
https://www.centos.org/docs/5/html/5.2/ ... t-log.html,我尽了较大努力作正确理解
然后重启 vsftpd,尝试上传,查看 /var/log/vsftpd.log 和 /var/log/xferlog
另附常见问题:
1. 文件系统权限问题。用楼上的方法排除。
2. 防火墙问题(登录发送指令和传输数据的端口不同)。可直接禁用防火墙 ufw 测试。参考
http://serverfault.com/questions/513404 ... load-files
3. ......
主动模式下,服务器向客户端主动发起连接。要保证客户端不被防火墙阻挡。数据端口由客户端指定
被动模式下,客户端先发送PASV令服务器开始监听,再向服务器发起连接。要保证服务器不被防火墙阻挡。数据端口由服务器(在指定范围内)随机指定
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#89
帖子
由 montana » 2016-01-25 10:53
百度了一通,一阵乱改,现在搞的都无法登录了。显示如下。
代码: 全选
montana@L440:~$ ftp localhost
Connected to localhost.
220 Welcome to Michael's FTP service.
Name (localhost:montana): michael
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/montana/www
Login failed.
421 Service not available, remote server has closed connection
ftp>
尝试用楼上的方法继续调整。
-
montana
- 帖子: 103
- 注册时间: 2007-08-11 15:56
- 系统: Ubuntu 16.04
#90
帖子
由 montana » 2016-01-25 10:59
刚才看到log有点乱,删除了部分。现在是比较完整的。
代码: 全选
Sun Jan 24 23:56:20 2016 [pid 9258] [michael] OK LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:24 2016 [pid 9268] CONNECT: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:26 2016 [pid 9267] [anonymous] FAIL LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:27 2016 [pid 9272] CONNECT: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:27 2016 [pid 9270] [michael] OK LOGIN: Client "::ffff:192.168.1.8"
Sun Jan 24 23:56:36 2016 [pid 9285] CONNECT: Client "::ffff:192.168.1.2"
Sun Jan 24 23:56:36 2016 [pid 9284] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Sun Jan 24 23:56:40 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:57:06 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:58:25 2016 [pid 9288] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Sun Jan 24 23:59:10 2016 [pid 9314] CONNECT: Client "::ffff:192.168.1.2"
Sun Jan 24 23:59:10 2016 [pid 9313] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Sun Jan 24 23:59:17 2016 [pid 9317] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Mon Jan 25 00:00:07 2016 [pid 9333] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:09 2016 [pid 9332] [anonymous] FAIL LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:11 2016 [pid 9337] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 00:00:12 2016 [pid 9335] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 09:33:36 2016 [pid 2093] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:36 2016 [pid 2092] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:42 2016 [pid 2097] [michael] OK DOWNLOAD: Client "::ffff:192.168.1.2", "/index.html", 57 bytes, 0.53Kbyte/sec
Mon Jan 25 09:33:56 2016 [pid 2141] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:33:56 2016 [pid 2139] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:34:10 2016 [pid 2144] [michael] OK DOWNLOAD: Client "::ffff:192.168.1.2", "/index.html", 57 bytes, 88.92Kbyte/sec
Mon Jan 25 09:39:00 2016 [pid 2144] [michael] FAIL UPLOAD: Client "::ffff:192.168.1.2", "/??????1.accdb", 0.00Kbyte/sec
Mon Jan 25 09:51:26 2016 [pid 2523] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:51:26 2016 [pid 2522] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:52:25 2016 [pid 2530] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:52:25 2016 [pid 2529] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:54:27 2016 [pid 2563] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:54:27 2016 [pid 2562] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:56:29 2016 [pid 2575] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:56:29 2016 [pid 2574] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:20 2016 [pid 2602] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:20 2016 [pid 2601] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:32 2016 [pid 2609] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:32 2016 [pid 2608] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:38 2016 [pid 2617] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:57:38 2016 [pid 2615] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 09:58:48 2016 [pid 2646] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 09:58:48 2016 [pid 2645] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:00:50 2016 [pid 2656] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:00:50 2016 [pid 2655] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:01:33 2016 [pid 2683] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:01:33 2016 [pid 2682] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:01:38 2016 [pid 2690] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:01:38 2016 [pid 2689] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:03:40 2016 [pid 2709] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:03:40 2016 [pid 2708] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:05:42 2016 [pid 2726] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:05:42 2016 [pid 2725] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:06:34 2016 [pid 2752] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:06:34 2016 [pid 2751] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:08:36 2016 [pid 2775] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:08:36 2016 [pid 2774] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:10:20 2016 [pid 3721] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:10:20 2016 [pid 3720] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:12:22 2016 [pid 3752] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:12:22 2016 [pid 3751] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:13:44 2016 [pid 3775] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 10:13:49 2016 [pid 3774] [montana] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 10:14:00 2016 [pid 3782] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:00 2016 [pid 3781] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:05 2016 [pid 3789] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:05 2016 [pid 3788] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:13 2016 [pid 3796] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:13 2016 [pid 3795] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:16 2016 [pid 3803] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:14:16 2016 [pid 3802] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:16:18 2016 [pid 3879] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:16:18 2016 [pid 3878] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:18:17 2016 [pid 8855] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:18:17 2016 [pid 8854] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:20:18 2016 [pid 8966] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:20:19 2016 [pid 8965] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:22:20 2016 [pid 9031] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:22:20 2016 [pid 9030] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:24:22 2016 [pid 9069] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:24:22 2016 [pid 9068] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:26:24 2016 [pid 9118] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:26:24 2016 [pid 9117] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:28:26 2016 [pid 9158] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:28:26 2016 [pid 9157] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:30:28 2016 [pid 9193] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:30:28 2016 [pid 9192] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:19 2016 [pid 9223] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:19 2016 [pid 9222] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:28 2016 [pid 9231] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:28 2016 [pid 9229] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:31 2016 [pid 9237] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:31 2016 [pid 9236] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:31:53 2016 [pid 9248] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 10:31:59 2016 [pid 9246] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 10:33:33 2016 [pid 9275] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:33:33 2016 [pid 9274] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:35:35 2016 [pid 9287] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:35:35 2016 [pid 9286] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:37:37 2016 [pid 19531] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:37:37 2016 [pid 19530] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:39:39 2016 [pid 2566] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:39:39 2016 [pid 2565] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:41:41 2016 [pid 12207] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:41:41 2016 [pid 12206] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:43:43 2016 [pid 17718] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:43:43 2016 [pid 17717] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:45:44 2016 [pid 17913] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:45:44 2016 [pid 17912] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:48:05 2016 [pid 1289] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:48:05 2016 [pid 1288] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:48:29 2016 [pid 2253] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 10:48:34 2016 [pid 2252] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 10:49:55 2016 [pid 2355] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:49:55 2016 [pid 2354] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:50:35 2016 [pid 2393] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:50:35 2016 [pid 2391] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:50:39 2016 [pid 2399] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:50:39 2016 [pid 2398] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:50:47 2016 [pid 2407] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 10:50:51 2016 [pid 2406] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 10:52:41 2016 [pid 2508] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:52:41 2016 [pid 2507] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:54:43 2016 [pid 2529] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:54:43 2016 [pid 2528] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:56:27 2016 [pid 2563] CONNECT: Client "::ffff:127.0.0.1"
Mon Jan 25 10:56:27 2016 [pid 2563] FTP response: Client "::ffff:127.0.0.1", "220 Welcome to Michael's FTP service."
Mon Jan 25 10:56:29 2016 [pid 2563] FTP command: Client "::ffff:127.0.0.1", "USER michael"
Mon Jan 25 10:56:29 2016 [pid 2563] [michael] FTP response: Client "::ffff:127.0.0.1", "331 Please specify the password."
Mon Jan 25 10:56:31 2016 [pid 2563] [michael] FTP command: Client "::ffff:127.0.0.1", "PASS <password>"
Mon Jan 25 10:56:31 2016 [pid 2561] [michael] OK LOGIN: Client "::ffff:127.0.0.1"
Mon Jan 25 10:56:45 2016 [pid 2569] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:56:45 2016 [pid 2569] FTP response: Client "::ffff:192.168.1.2", "220 Welcome to Michael's FTP service."
Mon Jan 25 10:56:45 2016 [pid 2569] FTP command: Client "::ffff:192.168.1.2", "USER michael"
Mon Jan 25 10:56:45 2016 [pid 2569] [michael] FTP response: Client "::ffff:192.168.1.2", "331 Please specify the password."
Mon Jan 25 10:56:45 2016 [pid 2569] [michael] FTP command: Client "::ffff:192.168.1.2", "PASS <password>"
Mon Jan 25 10:56:45 2016 [pid 2568] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:57:05 2016 [pid 2576] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:57:05 2016 [pid 2576] FTP response: Client "::ffff:192.168.1.2", "220 Welcome to Michael's FTP service."
Mon Jan 25 10:57:05 2016 [pid 2576] FTP command: Client "::ffff:192.168.1.2", "USER michael"
Mon Jan 25 10:57:05 2016 [pid 2576] [michael] FTP response: Client "::ffff:192.168.1.2", "331 Please specify the password."
Mon Jan 25 10:57:05 2016 [pid 2576] [michael] FTP command: Client "::ffff:192.168.1.2", "PASS <password>"
Mon Jan 25 10:57:05 2016 [pid 2575] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:57:08 2016 [pid 2583] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:57:08 2016 [pid 2583] FTP response: Client "::ffff:192.168.1.2", "220 Welcome to Michael's FTP service."
Mon Jan 25 10:57:08 2016 [pid 2583] FTP command: Client "::ffff:192.168.1.2", "USER michael"
Mon Jan 25 10:57:08 2016 [pid 2583] [michael] FTP response: Client "::ffff:192.168.1.2", "331 Please specify the password."
Mon Jan 25 10:57:08 2016 [pid 2583] [michael] FTP command: Client "::ffff:192.168.1.2", "PASS <password>"
Mon Jan 25 10:57:08 2016 [pid 2582] [michael] OK LOGIN: Client "::ffff:192.168.1.2"
Mon Jan 25 10:58:15 2016 [pid 2623] CONNECT: Client "::ffff:192.168.1.2"
Mon Jan 25 10:58:15 2016 [pid 2623] FTP response: Client "::ffff:192.168.1.2", "220 Welcome to Michael's FTP service."
Mon Jan 25 10:58:15 2016 [pid 2623] FTP command: Client "::ffff:192.168.1.2", "USER michael"
Mon Jan 25 10:58:15 2016 [pid 2623] [michael] FTP response: Client "::ffff:192.168.1.2", "331 Please specify the password."
Mon Jan 25 10:58:15 2016 [pid 2623] [michael] FTP command: Client "::ffff:192.168.1.2", "PASS <password>"
Mon Jan 25 10:58:15 2016 [pid 2622] [michael] OK LOGIN: Client "::ffff:192.168.1.2"