SSH client

SSH client

December 23, 2022

SSH configuration

This is the mapping between config file /.ssh/config and ssh cli options.

config file fieldcli optionDescription
ForwardAgent-A or -aEnable to use locale machine’s keys on remote machines

SSH password

Store the key and access on remote machine without inputting a password.

See stackoverflow for details.

How to add password to the private key without a password

Use: ssh-keygen -p -f /path/to/key. For example, ssh-keygen -p -f ~/.ssh/id_rsa

See stackoverflow for more details.

Trouble shootings

When you run SSH, you get an error Pseudo-terminal will not be allocated because stdin is not a terminal.

I wanted to get one time token from 1 password and pass it to SSH for the server’s 2FA. I tried to run next for this, but failed

> echo (op item get --otp "server" --vault "vault") | ssh server
Pseudo-terminal will not be allocated because stdin is not a terminal.

So I ended up running like next

> op item get --otp "server" --vault "vault" && ssh server

See this article for example.

Last updated on