When connecting to some linux servers over ssh with my openSUSE 15.1 machine, I get weird EOF and syntax errors. I run pretty much a standard setup and haven't changed anything but enabling pubkey authentication.
This is what happens:
~> 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.
Is the error generated on my local machine or is it originating from the remote server, before dropping the connection?
The output of ssh -v
is:
~> 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
What may I do to fix this issue, without changing all the remote configurations?
ssh -v randomserver.hostname
and add the output to the question. If you didn't play with the remote server.bashrc
file, most probably.ssh/config
(or/etc/ssh/ssh_config
) has incorrect syntax.ForceCommand
option insshd_config
, but they have unmatched quotes in it. Are you the remote server's admin?ForceCommand
option enabled in the remote sshd_config. I am the administrator, yes.