Score:0

Install SSH key in an account that has no "usable" shell

cn flag

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?

Score:1
cn flag

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)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.