Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCP Failure - Error 255 #401

Open
KarlAustin opened this issue Jun 30, 2023 · 0 comments
Open

SCP Failure - Error 255 #401

KarlAustin opened this issue Jun 30, 2023 · 0 comments

Comments

@KarlAustin
Copy link

Hi,

Having trouble with SCP. SSH via the bastion works fine.

BASTION_SCP_EXTRA_ARGS="-v" scp -P 2222 -S ~/.bastion/scp_helper1 -i ~/.ssh/id_ed25519 a-local-file [email protected]:/home/username

Results in:

OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to bastion1.example.org [192.168.99.1] port 22.
debug1: Connection established.
debug1: identity file /home/localuser/.ssh/id_ed25519 type 3
debug1: identity file /home/localuser/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1
debug1: match: OpenSSH_8.9p1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to bastion1.example.org:22 as 'KarlAustin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-ed25519 SHA256:nGDbyi2hY4u2nDQcfvA1JZhLX0a1d8umjx1LhUd0SqA
debug1: Host 'bastion1.example.org' is known and matches the ED25519 host key.
debug1: Found key in /home/localuser/.ssh/known_hosts:85
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/localuser/.ssh/id_ed25519 ED25519 SHA256:jXXd48b6FgW33arWYxN3ds7PbrY1flRJX+Aaph+7iQL explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: kex_input_ext_info: [email protected] (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
*------------------------------------------------------------------------------*
|THIS IS A PRIVATE COMPUTER SYSTEM, UNAUTHORIZED ACCESS IS STRICTLY PROHIBITED.|
|ALL CONNECTIONS ARE LOGGED. IF YOU ARE NOT AUTHORIZED, DISCONNECT NOW.        |
*------------------------------------------------------------------------------*
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/localuser/.ssh/id_ed25519 ED25519 SHA256:jXXd48b6FgW33arWYxN3ds7PbrY1flRJX+Aaph+7iQL explicit
debug1: Server accepts key: /home/localuser/.ssh/id_ed25519 ED25519 SHA256:jXXd48b6FgW33arWYxN3ds7PbrY1flRJX+Aaph+7iQL explicit
Enter passphrase for key '/home/localuser/.ssh/id_ed25519':
debug1: Authentication succeeded (publickey).
Authenticated to bastion1.example.org ([192.168.99.1]: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: /home/bastionUser/.ssh/authorized_keys2:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/bastionUser/.ssh/authorized_keys2:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: Sending env LANG = C.UTF-8
debug1: Sending command: --user username --port 2222 --host 172.168.99.1 --osh scp --scp-cmd scp#-t#/home/username
>>> Hello bastionUser, transferring your file through the bastion to [email protected]:2222...
[email protected]: Permission denied (publickey).

Error launching transfer: Command exited with status 255
lost connection
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2348, received 3308 bytes, in 0.8 seconds
Bytes per second: sent 2940.8, received 4143.2
debug1: Exit status 100

I can see by enabling debug logging in sshd on the server I am scp'ing to that the key is accepted:

Accepted key ED25519 SHA256:<hash> found at /home/username/.ssh/authorized_keys:1

I then see:

Postponed publickey for username from <bastion-ip> port 54364 ssh2 [preauth]
Connection closed by authenticating user username <bastion-ip> port 54364 [preauth]

What I never see is a prompt to decrypt the group ssh key for the group this server is in. So I'm guessing that's where the issue lies?

Is there a way to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant