SSHは使用できません。終了ステータス 254 への接続は直ちに終了しました。

SSHは使用できません。終了ステータス 254 への接続は直ちに終了しました。

私が最後に覚えているのは、ソフトとハードメモリのロックulimitを無制限に変更したことです。これで、コンピュータにSSHでアクセスできません。

これはSSHログです。

Authenticated to IP ([IP]:22).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LC_CTYPE = 
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Wed Aug  6 07:18:07 2014 from IP-SOURCE
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Connection to IP closed.
Transferred: sent 4256, received 2504 bytes, in 0.4 seconds
Bytes per second: sent 9616.9, received 5658.0
debug1: Exit status 254

ここに投稿する前に、これまで成功していないまま、次のことを試しました。

  1. norc noprofileを使ってログインしてみてください。ssh user@host 'bash --noprofile'

  2. 強制的にttyssh -t user@host

  3. bash_profileを移動しました。 SSHで試してくださいssh user@host

  4. ファイル名を変更してlimits.conf読まないことを願っています。

  5. SSH サーバーを再起動します。

  6. knifeasでコマンドを実行するknife ssh "name:server" "come_command"

  7. ssh user@host 'ulimit -l 64'、、、、ssh user@host 'ulimit -S -l 64'ssh user@host 'ulimit -H -l 64'ssh user@host 'exec ulimit -H -l 64'

ssh user@host "some_command"inline:コマンドを実行するこの方法は単純なディレクトリのリストを取得できないため、うまくいくかどうかわかりません。再起動も試みましたが、ssh user@host 'reboot'コマンドが実行されていないようです。また、成功せずにAWSでマシンを再起動しました。

SSHの試みは失敗しますか? sshでサーバーに接続する方法はありますか?

ベストアンサー1

変更を試す

UsePAM yes

存在する

UsePAM no

/etc/ssh/sshd_configCentOS用)

おすすめ記事