ssh wget连接被拒绝了

时间:2017-01-18 15:02:24

标签: ssh wget

我有3台WHM服务器,我想将一些文件从server1和server2传输到server3。

我在server1上备份了文件,在server2上备份了数据库,现在我需要使用SSH从server1和server2获取文件到server3。

我使用SSH登录到server3并使用wget命令从server1获取文件 - 工作正常。当我尝试使用wget从server2获取文件时,我收到“连接被拒绝”错误。

可能有什么问题?

编辑:我使用在线工具检查端口是否在server2打开,我发现端口22和80已关闭。这很奇怪,因为当我登录WHM并检查防火墙配置时,两个端口都列在TCP_IN,TCP_OUT,UDP_IN和UDP_OUT下。

如何使用ssh或whm打开端口?

我也检查了server1并打开了端口,所以我想这就是为什么我无法从server2获取文件,因为端口22和80已关闭。

这是netstat -lan |的输出egrep LISTEN

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2095            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2096            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN
tcp        0      0 208.85.2.142:53         0.0.0.0:*               LISTEN
tcp        0      0 208.85.2.141:53         0.0.0.0:*               LISTEN
tcp        0      0 208.85.2.140:53         0.0.0.0:*               LISTEN
tcp        0      0 208.85.2.139:53         0.0.0.0:*               LISTEN
tcp        0      0 208.85.2.138:53         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2082            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2083            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2086            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2087            0.0.0.0:*               LISTEN
tcp6       0      0 :::587                  :::*                    LISTEN
tcp6       0      0 :::110                  :::*                    LISTEN
tcp6       0      0 :::143                  :::*                    LISTEN
tcp6       0      0 ::1:783                 :::*                    LISTEN
tcp6       0      0 :::111                  :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::465                  :::*                    LISTEN
tcp6       0      0 :::21                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::25                   :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 :::993                  :::*                    LISTEN
tcp6       0      0 :::995                  :::*                    LISTEN
unix  2      [ ACC ]     STREAM     LISTENING     238522   /var/cpanel/php-fpm/cpanelphpmyadmin/sock
unix  2      [ ACC ]     STREAM     LISTENING     1051941  /var/lib/mysql/mysql.sock
unix  2      [ ACC ]     STREAM     LISTENING     14357    /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     743720   /var/run/dovecot/stats
unix  2      [ ACC ]     STREAM     LISTENING     743726   /var/run/dovecot/ssl-params
unix  2      [ ACC ]     STREAM     LISTENING     1329315  /usr/local/cpanel/var/cpauthd.sock
unix  2      [ ACC ]     STREAM     LISTENING     1329316  /usr/local/cpanel/var/cpdoveauthd.sock
unix  2      [ ACC ]     STREAM     LISTENING     1318256  /var/cpanel/userhomes/cpanelconnecttrack/p0f.socket
unix  2      [ ACC ]     STREAM     LISTENING     743728   /var/run/dovecot/login/ssl-params
unix  2      [ ACC ]     STREAM     LISTENING     743732   /var/run/dovecot/replicator
unix  2      [ ACC ]     STREAM     LISTENING     743736   /var/run/dovecot/replication-notify
unix  2      [ ACC ]     STREAM     LISTENING     247837   /var/clamd
unix  2      [ ACC ]     STREAM     LISTENING     743739   /var/run/dovecot/login/pop3
unix  2      [ ACC ]     STREAM     LISTENING     1053251  /var/run/cphulkd.sock
unix  2      [ ACC ]     STREAM     LISTENING     743747   /var/run/dovecot/log-errors
unix  2      [ ACC ]     STREAM     LISTENING     743751   /var/run/dovecot/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     743755   /var/run/dovecot/ipc
unix  2      [ ACC ]     STREAM     LISTENING     743757   /var/run/dovecot/login/ipc-proxy
unix  2      [ ACC ]     STREAM     LISTENING     25680    /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     743761   /var/run/dovecot/indexer-worker
unix  2      [ ACC ]     STREAM     LISTENING     962684   /var/cpanel/php-fpm/operationsports/sock
unix  2      [ ACC ]     STREAM     LISTENING     743765   /var/run/dovecot/indexer
unix  2      [ ACC ]     STREAM     LISTENING     743767   /var/run/dovecot/login/imap
unix  2      [ ACC ]     STREAM     LISTENING     753466   /var/cpanel/dnsadmin/sock
unix  2      [ ACC ]     STREAM     LISTENING     12377    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     743771   /var/run/dovecot/imap-master
unix  2      [ ACC ]     STREAM     LISTENING     12380    /var/run/rpcbind.sock
unix  2      [ ACC ]     STREAM     LISTENING     743775   /var/run/dovecot/imap-urlauth-worker
unix  2      [ ACC ]     STREAM     LISTENING     743777   /var/run/dovecot/token-login/imap-urlauth
unix  2      [ ACC ]     STREAM     LISTENING     743781   /var/run/dovecot/imap-urlauth
unix  2      [ ACC ]     STREAM     LISTENING     743789   /var/run/dovecot/imap-hibernate
unix  2      [ ACC ]     STREAM     LISTENING     743793   /var/run/dovecot/doveadm-server
unix  2      [ ACC ]     STREAM     LISTENING     743797   /var/run/dovecot/dns-client
unix  2      [ ACC ]     STREAM     LISTENING     743801   /var/run/dovecot/director-admin
unix  2      [ ACC ]     STREAM     LISTENING     743805   /var/run/dovecot/dict
unix  2      [ ACC ]     STREAM     LISTENING     743809   /var/run/dovecot/dict-async
unix  2      [ ACC ]     STREAM     LISTENING     743813   /var/run/dovecot/config
unix  2      [ ACC ]     STREAM     LISTENING     743815   /var/run/dovecot/login/login
unix  2      [ ACC ]     STREAM     LISTENING     743817   /var/run/dovecot/token-login/tokenlogin
unix  2      [ ACC ]     STREAM     LISTENING     743821   /var/run/dovecot/auth-login
unix  2      [ ACC ]     STREAM     LISTENING     743825   /var/run/dovecot/auth-client
unix  2      [ ACC ]     STREAM     LISTENING     743829   /var/run/dovecot/auth-userdb
unix  2      [ ACC ]     STREAM     LISTENING     743833   /var/run/dovecot/auth-master
unix  2      [ ACC ]     STREAM     LISTENING     221082   /var/run/nscd/socket
unix  2      [ ACC ]     STREAM     LISTENING     743837   /var/run/dovecot/auth-worker
unix  2      [ ACC ]     STREAM     LISTENING     743841   /var/run/dovecot/anvil
unix  2      [ ACC ]     SEQPACKET  LISTENING     25763    /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     743845   /var/run/dovecot/anvil-auth-penalty
unix  2      [ ACC ]     STREAM     LISTENING     743849   /var/run/dovecot/quota-status
unix  2      [ ACC ]     STREAM     LISTENING     743852   /var/run/dovecot/master
unix  2      [ ACC ]     STREAM     LISTENING     1313199  /etc/apache2/run/cgid_sock.28821
unix  2      [ ACC ]     STREAM     LISTENING     671672   /var/run/ftpd.sock
unix  2      [ ACC ]     STREAM     LISTENING     1329314  /usr/local/cpanel/var/cpwrapd.sock
unix  2      [ ACC ]     STREAM     LISTENING     238524   /var/cpanel/php-fpm/cpanelphppgadmin/sock
unix  2      [ ACC ]     STREAM     LISTENING     238526   /var/cpanel/php-fpm/cpanelroundcube/sock

编辑:我检查了server1和server2上的/ etc / ssh / sshd_config,一切都是一样的,但由于某种原因,server2拒绝连接。

1 个答案:

答案 0 :(得分:0)

问题解决了。我使用在线工具检查已打开的端口,端口22和80已关闭,这就是连接被拒绝的原因。

谢谢大家的帮助。