3

I am working on a project for a client from which we are using multiple docker containers on a host machine. I need to copy some files from my computer to the host machine, but when using an SFTP-client (cyberduck) I cannot connect to the server.

The address has multiple @ in it, which might be why I am not able to connect?

The SSH-command is like this:

ssh username@name@[email protected]

I've tried putting the username in the SFTP client like username@name@identifier and server as domain.com, but I still cannot connect.

Is this even possible to do? Can I check through the terminal of the host if I am able to sftp into the host?

Log when SSH:ing into the server

OpenSSH_7.7p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to domain.com port 22. debug1: Connection established. debug1: identity file /Users/user/.ssh/id_rsa type 0 debug1: key_load_public: No such file or directory debug1: Local version string SSH-2.0-OpenSSH_7.7 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.3 debug1: match: OpenSSH_7.3 pat OpenSSH* compat 0x04000000 debug1: Authenticating to domain.com:22 as 'username@name@identifier' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: [email protected] debug1: kex: host key algorithm: ecdsa-sha2-****** debug1: kex: server->client cipher: ****-poly***@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: *****-poly***@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: *********** debug1: Host 'domain.com' is known and matches the ECDSA host key. debug1: Found key in /Users/user/.ssh/known_hosts:16 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 134217728 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering public key: RSA SHA256:******* /Users/user/.ssh/id_rsa debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Trying private key: /Users/user/.ssh/id_dsa debug1: Trying private key: /Users/user/.ssh/id_ecdsa debug1: Next authentication method: keyboard-interactive debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Next authentication method: password username@name@[email protected]'s password: debug1: Authentication succeeded (password). Authenticated to domain.com ([12.345.678.9101]: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: Sending environment. debug1: Sending env LC_CTYPE = UTF-8 This session is being recorded Using username "other_username". LEGAL NOTICE ------------ This is a PRIVATE computer system. All unauthorized use or unauthorized access is prohibited according to local laws and may lead to prosecution. 

Log when SFTP:ing from terminal

Authenticated to Authenticated to domain.com ([12.345.678.9101]: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: Sending environment. debug1: Sending env LC_CTYPE = UTF-8 debug1: Sending subsystem: sftp subsystem request failed on channel 0 Connection closed 
8
  • 1
    "Cannot connect" is kind of vague. Can you show us the logs on either end? Can you run ssh -v and/or add debug instructions to the ssh server on the receiving end? Please update this question with the relevant log information. Commented Mar 18, 2019 at 13:37
  • Try this: 'username@name'@'identifier'... Commented Mar 18, 2019 at 13:38
  • Also, cyberduck is a windows program. Consider the possibility that the problem lies on the client end - especially if, as you claim, ssh itself works. Commented Mar 18, 2019 at 13:48
  • 1
    Excellent, we're already a step further. subsystem request failed on channel 0 The server couldn't load the subsystem. Now check the logs from the server end, preferably with debug enabled. Commented Mar 18, 2019 at 13:58
  • 3
    Have you tried scp? I believe that sftp relies on the server running an ftpd daemon, but scp only needs sshd. Commented Mar 18, 2019 at 14:18

2 Answers 2

2

I had to modify the old /etc/ssh/sshd_config. I added the following and restarted the machine:

# Allow client to pass locale environment variables AcceptEnv LANG LC_* # override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server 
1
  • 4
    just restart or reload the sshd service, sudo service ssh reload instead of rebooting system Commented Apr 3, 2020 at 5:26
0

I had the same issue and ended up adding the Subsystem line to /etc/ssh/sshd_config, then reloading sshd service. That solved it for me. My setup is a vanilla installation of Xubuntu 20.04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.