0

A remote SSH server has a guest account with a known, non-blank password, that when logged in directly executes a text-based terminal game (not sure if via command, shell, or another method). The connection closes whenever the game exits, so there is no "usable" shell to run commands.

I want to connect to this server using a password-less key, and I've already checked that the SSH server does allow keypair authentication. The problem is: how to add/copy a pubkey to the remote ~/.ssh/authorized_keys file?

I've tried both ssh-copy-id and scp, and both fail with:

me@home ~ $ ssh-copy-id -i ~/.ssh/id_ed25519.game.pub [email protected]
[email protected]'s password: 
Error opening terminal: unknown.
me@home ~ $

So, given this scenario and that login/password authentication works fine, is there any way to establish a connection without a password?

1 Answer 1

1

If the ssh config of the server allows it, you can specify a different command/shell as an argument to the ssh command.

eg:

ssh [email protected] /bin/bash

However, given that you can't use ssh-copy-id nor scp, I expect that that sshd config will ForceCommand to ignore any command/subsystem request from the client and force the game to be run instead. If that's the case, you're out of luck. You will have to find another way to add your key (basically ask the server admin)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .