无法启动 ssh 服务器

无法启动 ssh 服务器

后台内核:3.0.0-14-generic 操作系统:Ubuntu 11.10 - 桌面版

问题:无法启动 ssh 守护进程系统日志(片段):

[  451.862562] init: ssh main process (3042) terminated with status 255
[  451.862641] init: ssh main process ended, respawning
[  451.873345] init: ssh main process (3045) terminated with status 255
[  451.873405] init: ssh main process ended, respawning
[  451.883863] init: ssh main process (3048) terminated with status 255
[  451.883923] init: ssh main process ended, respawning
[  451.895982] init: ssh main process (3051) terminated with status 255
[  451.896090] init: ssh main process ended, respawning
[  451.907059] init: ssh main process (3054) terminated with status 255
[  451.907130] init: ssh main process ended, respawning
[  451.917883] init: ssh main process (3057) terminated with status 255
[  451.917951] init: ssh respawning too fast, stopped

问题出现在启动时并且尝试手动执行命令(任一命令):

sudo service ssh start
sudo /etc/init.d/ssh start

尝试修复:

  1. 在 sshd_config 中:将 ListenAddress 更改为 0.0.0.0 和实际的 LAN IP 地址
  2. 将 HUP 发送到 ssh 进程(由于没有 ssh 进程,所以最终结果什么也没发生)。
  3. 重新安装 openssh-server

还没有和 upstart 做过任何事情。

有什么建议吗?

以下参考

sshd_config 文件:

# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22

# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0

Protocol 2

# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no


# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd yes
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

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

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
;UsePAM yes

在 /etc/网络/接口:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

# Set up the bridge interface for OpenVPN
#auto br0
#iface br0 inet static
#address 10.0.1.199
#netmask 255.255.255.0
#gateway 10.0.1.1
#bridge_ports eth0

#iface eth0 inet manual
#up ifconfig $IFACE 0.0.0.0 up
#up ip link set $IFACE promisc on
#down ip link set $IFACE promisc off
#down ifconfig $IFACE down

附加输出:

ps auxw | grep ssh
kevdog    1916  0.0  0.0   3856   180 ?        Ss   10:12   0:00 /usr/bin/ssh-agent  /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-session --session=gnome-with-compiz
kevdog    3170  0.0  0.0   4448   796 pts/0    S+   11:32   0:00 grep --color=auto ssh

答案1

问题是创建以下行

;UsePAM 是

应该是这样的

UsePAM 是

相关内容