If a remote server has password access disabled and relies on authorized SSH keys to manage user access, things can get tricky.
The scenario this gist will solve is:
- Server A (10.0.1.20) has a user account, ubuntu, that we need to be able to use to login to it from a variety of hosts.
- User A has access to a Server A (10.0.1.20) via SSH. Therfore User A's public key is present in Server A's 'authorized_keys' file.
- User A's private key is present on a Bastion host that allows password logins.
- User B needs to access Server A, and therefore needs her public key copied to Server A. Server A doesn't allow password logins, so we're stuck.