Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
3 years agoAuthenticate using CLI (non-gui)
I have enabled the 1Password SSH Agent which works fine, apart from one usecase: accessing my computer remotely and then trying to access other SSH hosts. It then prompts for a password using the GUI...
Former Member
3 years agoHaha, weird, the site was indeed served in from the mobile endpoint (which is using a different markup, not just a responsive layout) and had a different look, but I never noticed the first two characters missing in the codeblock as the indented bits looked fine. The mobile version looked fine when I opened DevTools and checked off a mobile browser before reloading, so it seemed to only apply to the actual device. Maybe just a fluke, who knows :)
Anyway, this worked (almost flawlessly, see below), so thanks for that!
ssh -v git@github.com
...
Hi fatso83! You've successfully authenticated, but GitHub does not provide shell access.
But ... there was something wrong in the shell command, as you might spot from the verbose output, see line 4:
$ LC_ALL=C ssh -v git@github.com
OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/carlerik/.ssh/config
debug1: Executing command: 'test -z $SSH_CONNECTION'
/bin/bash: line 1: test: too many arguments
...
After some debugging, I found it was simply missing quotes, as the $SSH_CONNECTION
variable would result in multiple tokens:
```
$ LC_ALL=C eval 'test -z $SSH_CONNECTION'
-bash: test: too many arguments
$ eval 'echo test -z $SSH_CONNECTION'
test -z 127.0.0.1 55738 127.0.0.1 22
Adding quotes:
$ eval 'test -z "$SSH_CONNECTION"'
$ # no error :)
```
Adding quotes would remove the error, but it really made no functional difference: we were only supposed to use the on-host 1Password agent if the test
command failed, and it only failed (for the wrong reasons) if the string we tested for was present :)