Hosting a Teleconsole instance on macOS: "500 Internal Server Error: ssh: no key found"
I'm trying to play around with secure Teleconsole sessions, using macOS 10.12.6 to host. However, I receive this error when running teleconsole -vv -i JesseTG:
Giving My GitHub Username
jesse-mac% teleconsole -vv -i JesseTG
DEBU[0000] Server: https://teleconsole.com:443, Args: [] file="clt/main.go:39" func="clt.(*App).DebugDump"
INFO[0000] Ping http://as.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://eu.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] teleconsole.com responded in 137.243676ms file="geo/geo.go:60" func=geo.FindFastestEndpoint
INFO[0000] Getting version from https://teleconsole.com:443 file="clt/api_client.go:71" func="clt.(*APIClient).CheckVersion"
INFO[0000] Connecting to https://teleconsole.com:443 file="clt/api_client.go:105" func="clt.(*APIClient).CheckVersion"
Starting local SSH server on localhost...
Requesting a disposable SSH proxy on teleconsole.com for JesseTG...
INFO[0001] Requesting a new session for Jesse forwarding <nil> file="clt/api_client.go:120" func="clt.(*APIClient).RequestNewSession"
500 Internal Server Error: ssh: no key found
DEBU[0002]
ERROR REPORT:
Original Error: *clt.HTTPClientError 500 Internal Server Error: ssh: no key found
Stack Trace:
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/api_client.go:147 github.com/gravitational/teleconsole/clt.(*APIClient).RequestNewSession
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/clt.go:97 github.com/gravitational/teleconsole/clt.StartBroadcast
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/main.go:182 github.com/gravitational/teleconsole/clt.(*App).Start
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/main.go:45 main.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/proc.go:192 runtime.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/asm_amd64.s:2087 runtime.goexit
User Message:
file="teleconsole-0.3.1/main.go:61" func=main.fatalIf
jesse-mac%
(Note that my username is Jesse, with a capital J)
Explicitly Giving a Key
If I try explicitly specifying a key, this is what happens:
jesse-mac% teleconsole -vv -i ~/.ssh/id_teleconsole.pub
DEBU[0000] Server: https://teleconsole.com:443, Args: [] file="clt/main.go:39" func="clt.(*App).DebugDump"
INFO[0000] Ping http://as.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://eu.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] teleconsole.com responded in 135.310141ms file="geo/geo.go:60" func=geo.FindFastestEndpoint
INFO[0000] Getting version from https://teleconsole.com:443 file="clt/api_client.go:71" func="clt.(*APIClient).CheckVersion"
INFO[0000] Connecting to https://teleconsole.com:443 file="clt/api_client.go:105" func="clt.(*APIClient).CheckVersion"
ERRO[0000] ssh: no key found file="lib/identity.go:86" func=lib.MakeIdentity
ssh: no key found
DEBU[0000]
ERROR REPORT:
Original Error: *errors.errorString ssh: no key found
Stack Trace:
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:179 github.com/gravitational/teleconsole/lib.loginFromFile
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:137 github.com/gravitational/teleconsole/lib.loginsFrom
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:82 github.com/gravitational/teleconsole/lib.MakeIdentity
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/clt.go:72 github.com/gravitational/teleconsole/clt.StartBroadcast
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/main.go:182 github.com/gravitational/teleconsole/clt.(*App).Start
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/main.go:45 main.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/proc.go:192 runtime.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/asm_amd64.s:2087 runtime.goexit
User Message:
file="teleconsole-0.3.1/main.go:61" func=main.fatalIf
jesse-mac%
I don't remember whether or not I'm supposed to give the private or the public key, so I tried both.
jesse-mac% teleconsole -vv -i ~/.ssh/id_teleconsole
DEBU[0000] Server: https://teleconsole.com:443, Args: [] file="clt/main.go:39" func="clt.(*App).DebugDump"
INFO[0000] Ping http://as.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://eu.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] teleconsole.com responded in 147.816031ms file="geo/geo.go:60" func=geo.FindFastestEndpoint
INFO[0000] Getting version from https://teleconsole.com:443 file="clt/api_client.go:71" func="clt.(*APIClient).CheckVersion"
INFO[0000] Connecting to https://teleconsole.com:443 file="clt/api_client.go:105" func="clt.(*APIClient).CheckVersion"
ERRO[0000] ssh: unmarshal error for field Keytype of type file="lib/identity.go:86" func=lib.MakeIdentity
ssh: unmarshal error for field Keytype of type
DEBU[0000]
ERROR REPORT:
Original Error: *errors.errorString ssh: unmarshal error for field Keytype of type
Stack Trace:
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:179 github.com/gravitational/teleconsole/lib.loginFromFile
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:137 github.com/gravitational/teleconsole/lib.loginsFrom
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/lib/identity.go:82 github.com/gravitational/teleconsole/lib.MakeIdentity
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/clt.go:72 github.com/gravitational/teleconsole/clt.StartBroadcast
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/src/github.com/gravitational/teleconsole/clt/main.go:182 github.com/gravitational/teleconsole/clt.(*App).Start
/private/tmp/teleconsole-20170210-20217-56o2fv/teleconsole-0.3.1/main.go:45 main.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/proc.go:192 runtime.main
/usr/local/Cellar/go/1.7.5/libexec/src/runtime/asm_amd64.s:2087 runtime.goexit
User Message:
file="teleconsole-0.3.1/main.go:61" func=main.fatalIf
jesse-mac%
SSH Directory
My ~/.ssh directory looks like this:
jesse-mac% ls -la ~/.ssh
total 56
drwx------ 9 Jesse staff 306 Jan 27 20:02 .
drwxr-xr-x+ 77 Jesse staff 2618 Jan 28 12:24 ..
-rw------- 1 Jesse staff 701 Jan 27 20:01 authorized_keys
-rw------- 1 Jesse staff 68 Jan 24 2017 config
-r-------- 1 Jesse staff 1766 Jan 26 2017 id_rsa
-rw------- 1 Jesse staff 401 Oct 18 2016 id_rsa.pub
-r-------- 1 Jesse staff 464 Jan 27 20:02 id_teleconsole
-rw------- 1 Jesse staff 100 Jan 27 20:02 id_teleconsole.pub
-rw-r--r-- 1 Jesse staff 3134 Jan 27 20:16 known_hosts
jesse-mac%
Both of those keys are associated with my GitHub account.
Unprotected
Unprotected teleconsole works as expected but is not what I'm trying to do:
jesse-mac% teleconsole -v
INFO[0000] Ping http://as.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://eu.teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://teleconsole.com/ping file="geo/geo.go:41" func=geo.FindFastestEndpoint.func1
INFO[0000] teleconsole.com responded in 136.570202ms file="geo/geo.go:60" func=geo.FindFastestEndpoint
INFO[0000] Getting version from https://teleconsole.com:443 file="clt/api_client.go:71" func="clt.(*APIClient).CheckVersion"
INFO[0000] Connecting to https://teleconsole.com:443 file="clt/api_client.go:105" func="clt.(*APIClient).CheckVersion"
Starting local SSH server on localhost...
Requesting a disposable SSH proxy on teleconsole.com for Jesse...
INFO[0000] Requesting a new session for Jesse forwarding <nil> file="clt/api_client.go:120" func="clt.(*APIClient).RequestNewSession"
Checking status of the SSH tunnel...
Your Teleconsole ID: <redacted>
WebUI for this session: https://teleconsole.com/s/<redacted>
To stop broadcasting, exit current shell by typing 'exit' or closing the window.
jesse-mac%
Actually, this might not be exclusive to macOS. This happens when I try to host a teleconsole instance on CentOS 7.2:
[jtalaveragre@login ~]$ teleconsole -vv -i JesseTG
DEBU[0000] Server: https://teleconsole.com:443, Args: [] file=clt/main.go:39 func=clt.(*App).DebugDump
INFO[0000] Ping http://eu.teleconsole.com/ping file=geo/geo.go:41 func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://as.teleconsole.com/ping file=geo/geo.go:41 func=geo.FindFastestEndpoint.func1
INFO[0000] Ping http://teleconsole.com/ping file=geo/geo.go:41 func=geo.FindFastestEndpoint.func1
INFO[0000] teleconsole.com responded in 133.519913ms file=geo/geo.go:60 func=geo.FindFastestEndpoint
INFO[0000] Getting version from https://teleconsole.com:443 file=clt/api_client.go:71 func=clt.(*APIClient).CheckVersion
INFO[0000] Connecting to https://teleconsole.com:443 file=clt/api_client.go:105 func=clt.(*APIClient).CheckVersion
Starting local SSH server on localhost...
Requesting a disposable SSH proxy on teleconsole.com for JesseTG...
INFO[0002] Requesting a new session for jtalaveragre forwarding <nil> file=clt/api_client.go:120 func=clt.(*APIClient).RequestNewSession
500 Internal Server Error: ssh: no key found
DEBU[0003]
ERROR REPORT:
Original Error: *clt.HTTPClientError 500 Internal Server Error: ssh: no key found
Stack Trace:
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/api_client.go:147 github.com/gravitational/teleconsole/clt.(*APIClient).RequestNewSession
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/clt.go:97 github.com/gravitational/teleconsole/clt.StartBroadcast
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/main.go:182 github.com/gravitational/teleconsole/clt.(*App).Start
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/main.go:45 main.main
/opt/go/src/runtime/proc.go:192 runtime.main
/opt/go/src/runtime/asm_amd64.s:2087 runtime.goexit
User Message:
file=teleconsole/main.go:61 func=main.fatalIf
[jtalaveragre@login ~]$
Here is what ~/.ssh looks like:
[jtalaveragre@login ~]$ ls -l ~/.ssh
total 256
-rw------- 1 jtalaveragre jtalaveragre 581 Oct 23 13:49 authorized_keys
-rw------- 1 jtalaveragre jtalaveragre 227 Oct 23 13:47 id_ecdsa
-rw------- 1 jtalaveragre jtalaveragre 180 Oct 23 13:47 id_ecdsa.pub
-r-------- 1 jtalaveragre jtalaveragre 1766 Jan 25 11:34 id_rsa
-rw------- 1 jtalaveragre jtalaveragre 401 Jan 25 11:35 id_rsa.pub
-r-------- 1 jtalaveragre jtalaveragre 464 Jan 27 20:02 id_teleconsole
-rw------- 1 jtalaveragre jtalaveragre 100 Jan 27 20:02 id_teleconsole.pub
-rw------- 1 jtalaveragre jtalaveragre 4073 Jan 29 15:26 known_hosts
[jtalaveragre@login ~]$
These are the same keys that I have on the macOS server in the previous post.
hm... interesting. will take a look, thanks for reporting this
I hate to bump a super old question, but I'm having the exact same issue (on Linux)
Input:
❯ teleconsole -i 12buntu -vv
Starting local SSH server on localhost...
Requesting a disposable SSH proxy on teleconsole.com for 12buntu...
500 Internal Server Error: ssh: no key found
~ ❯
Output:
ERROR REPORT:
Original Error: *clt.HTTPClientError 500 Internal Server Error: ssh: no key found
Stack Trace:
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/api_client.go:147 github.com/gravitational/teleconsole/clt.(*APIClient).RequestNewSession
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/clt.go:99 github.com/gravitational/teleconsole/clt.StartBroadcast
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/clt/main.go:182 github.com/gravitational/teleconsole/clt.(*App).Start
/home/ekontsevoy/go/src/github.com/gravitational/teleconsole/main.go:46 main.main
/opt/go/src/runtime/proc.go:204 runtime.main
/opt/go/src/runtime/asm_amd64.s:2338 runtime.goexit
User Message:
file=teleconsole/main.go:62 func=main.fatalIf
It just suddenly happened, it's worked before. I thought it was a problem with Github, but I'm able to use the same keys with other services.
I also tried using the public keys I have on my device (manually adding keys not through the Github API), which returned ssh: no key found
I even ran teleconsole on a VM, that way I could be sure that the problem isn't with my machine, and it still persisted. This led me to believe there was something wrong with my keys in particular, so I tried it using various other accounts. This somehow worked, and opened up a teleconsole session.
❯ teleconsole -i kontsevoy
Starting local SSH server on localhost...
Requesting a disposable SSH proxy on teleconsole.com for kontsevoy...
Checking status of the SSH tunnel...
Your Teleconsole ID: 5aq5c34aa04155dceb36ba9d5dc76975a57c8a18
WebUI is not available for key-restricted sessions
~ ❯
(This session is not still running of course.)
This behavior was also exhibited in the VM.
Thinking it was my ssh keys for some reason, I generated multiple new pairs in different formats, none of which worked. I have no idea why this suddenly started happening, but I really would like to try to resolve it.
Solution (For me):
I was using ed25519 keys, which apparently don't work.
My solution was to generate new keys with ssh-keygen -t rsa -b 4096 -C "[email protected]"