SSH経由で接続するときの構文エラー

SSH経由で接続するときの構文エラー

私のopenSUSE 15.1システムを使用してSSHを介していくつかのLinuxサーバーに接続すると、奇妙なEOFと構文エラーが発生します。公開鍵認証を有効にする以外に、変更なしにほぼ標準設定を実行しました。

何が起こるのか?

~> ssh randomserver.hostname
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
Connection to randomserver.hostname closed.

接続を切断する前に、私のローカルコンピュータでエラーが生成されましたか、それともリモートサーバーで発生しましたか?

出力はssh -v次のとおりです

~> ssh -v randomserver.hostname
OpenSSH_7.9p1, OpenSSL 1.1.0i-fips  14 Aug 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to randomserver.hostname [192.168.1.2] port 22.
debug1: Connection established.
debug1: identity file /home/myuser/.ssh/id_rsa type 0
debug1: identity file /home/myuser/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u7
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u7 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to randomserver.hostname:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
debug1: Host 'randomserver.hostname' is known and matches the ECDSA host key.
debug1: Found key in /home/myuser/.ssh/known_hosts
debug1: rekey after 134572247 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134572548 blocks
debug1: Will attempt key: /home/myuser/.ssh/id_rsa XXXX
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/myuser/.ssh/id_rsa XXXX
debug1: Server accepts key: /home/myuser/.ssh/id_rsa XXXX
debug1: Authentication succeeded (publickey).
Authenticated to randomserver.hostname ([192.168.1.2]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Remote: Forced command.
debug1: Remote: Forced command.
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: Sending env LANG = de_DE.utf8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
debug1: channel 0: free: client-session, nchannels 1
Connection to randomserver.hostname closed.
Transferred: sent 3864, received 3020 bytes, in 0.1 seconds
Bytes per second: sent 75479.5, received 58992.8
debug1: Exit status 1

すべてのリモート設定を変更せずにこの問題を解決するにはどうすればよいですか?

ベストアンサー1

この.ssh/authorized_keysファイルでは、ログインする前にコマンドを強制的に実行できます。構文エラー(使用法command="")が見つかる可能性があります。

これは、一意のキー識別子(IPアドレスとホスト名に加えて)を使用して管理者のログインをシステムログに記録するために使用されました。

おすすめ記事