SSHは実行中ですが、割り当てられたポートでリッスンしません。

SSHは実行中ですが、割り当てられたポートでリッスンしません。

最近では、Ubuntu 14.04.6 LTSを実行している2つのLinuxシステムにSSH経由で接続できなくなることがわかりました。常にポート43210に設定されており、少なくとも2018年から動作してきました。最近の再起動後、そのポートを使用して接続できなくなります。サービスが実行されていることを確認するために service コマンドを使用すると、次の結果が表示されます。

service ssh status
ssh start/running

だから効果があるようです。ただし、使用しようとすると、lsof -i -P | grep LISTEN サーバーnetstat -tunlpがどのポートでもリッスンしているのを見ることはできません。

ファイアウォールを確認してみると(私が知っているのは)ufwとiptablesの両方が無効になっているようです。

ufw status
Status: inactive

そして

iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source                   destination

Chain FORWARD(policy ACCEPT)
target prot opt source                   destination

Chain OUTPUT (policy ACCEPT)
target prot opt source                   destination


aptを使用してOpenSSH-Serverをアンインストールして再インストールしましたが、変更はありません。現在インストールされているバージョンは1:6.6p1-2ubuntu2.13です。

sshd_configの私の設定:

#comments
Port 43210
#comments
Protocol 2
#comments
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

#comments
UsePrivilegeSeperation yes

#comments
KeyRegenerationInterval 3600
ServerKeyBits 1024

#comments
SyslogFacility AUTH
LogLevel DEBUG

#Comments
LoginGraceTime 120
#comments
PermitRootLoing no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#comments

#comments
IgnoreRhosts yes
#comment
RhostsRSAAuthenticaion no
#comment
HostbasedAuthentication no
#comments

#comment
PermitEmptyPasswords no

#comments
ChallengeResponseAuthentication no

#comments

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLasLog yes
TCPKeepAlive yes
#comment

#comments
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

#comments
UsePAM yes

次のように接続しようとすると:

ssh <ip address> -p 43210
ssh: connect to host <ip address> port 43210: Connection refused

直接関係があるかどうかはわかりませんが、syslog-ngが実行されているように見えてもログが更新されないようです。これはSSH失敗と同時に発見されました。

一部の情報が欠落しているようです。問題を明確にするのに役立つ可能性がある他の情報を教えてください。

編集1
service ssh stop
/usr/sbin/sshd -d
debug1: sshd version OpenSSH_6.6.1, OpenSSL 1.01f 6 Jan 2014 
debug1: key_parse_private2: missing begin marker 
debug1: read PEM private key done: type RSA 
debug1: private host key #0 type 1 RSA 
debug1: key_parse_private2: missing begin marker 
debug1: read PEM private key done: type DSA 
debug 1: private host key: #1 type 2 DSA 
debug1: read PEM private key done: type ECDSA 
debug1: private host key: #2 type 3 ECDSA 
debug1: private host key: #3 type 4 ED25519 
/var/run/sshd must be owned by root and not group or world-writable.
ls -ld /var/ /var/run /var/run/sshd
drwxr-xr-x 15 root root 4096 Oct 24 09:46 /var/
lrwxrwxrwx  1 root root    4 May 13  2015 /var/run -> /run
drwxrwxrwx  2 root root   40 Oct 14 07:43 /var/run/sshd

ベストアンサー1

おすすめ記事