Skip to content

Login faster? #2

@LuKks

Description

@LuKks

Awesome work, works perfectly as intended!

One small thing, can we make it faster to login?

sudo journalctl -f -u ssh2incus.service

Sep 06 07:08:27 instance-20230425-2252 ssh2incus[2073189]: level=info msg=connection accepted, handing off to child process
Sep 06 07:08:27 instance-20230425-2252 ssh2incus[2073189]: level=info msg=started detached child process with pid 2301965
Sep 06 07:08:27 instance-20230425-2252 ssh2incus[2301965]: level=info msg=starting ssh2incus as child process, pid 2301965
Sep 06 07:08:27 instance-20230425-2252 ssh2incus[2301965]: level=info msg=child serving connection from 1.2.3.4:55484
Sep 06 07:08:28 instance-20230425-2252 ssh2incus[2301965]: level=error msg=auth (instance): failed to compare keys for ubuntu@instance.project+root: ssh: no key found session=b186d793
Sep 06 07:08:28 instance-20230425-2252 ssh2incus[2301965]: level=info msg=auth (host): succeeded for ubuntu@instance.project+root: ssh-ed25519 SHA256:oNLu5tGVH56hsU+tyd/+7487yW0IYdeVRoC2SWyVSXY session=b186d793

When I do e.g. ssh instance, in like half a second I see the logs above appear in the journalctl output (and maybe even these logs could be a tiny bit delayed due systemd logs etc so the actual execution is faster than it appears to be from the logs)

That's all good, but after the logs appears it takes like a full second or second and a half to actually shell into it

I know it sounds like ok it's just one second, but just wondering if there is an easy way to increase the speed

Especially if I already logged in once, then I exited the ssh, then I ssh into it again it should be pretty much instant

Maybe we can leave the internal server running until a configurable timeout to kill it e.g. 5 minutes


I tried without master process (although, I would really like to still have it thus the timeout idea) but then this happens:

ARGS="--inauth"
panic: send on closed channel within the logs

Sep 06 07:25:06 instance-20230425-2252 ssh2incus[2302826]: level=error msg=auth (instance): failed to compare keys for ubuntu@s2475755540.u68a014b49d204e83cfe71be1+root: ssh: no key found session=56b9e28e
Sep 06 07:25:06 instance-20230425-2252 ssh2incus[2302826]: level=info msg=auth (host): succeeded for ubuntu@s2475755540.u68a014b49d204e83cfe71be1+root: ssh-ed25519 SHA256:oNLu5tGVH56hsU+tyd/+7487yW0IYdeVRoC2SWyVSXY session=56b9e28e
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: level=error msg=auth (instance): failed to compare keys for ubuntu@s2475755540.u68a014b49d204e83cfe71be1+root: ssh: no key found session=c4dfec6e
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: level=info msg=auth (host): succeeded for ubuntu@s2475755540.u68a014b49d204e83cfe71be1+root: ssh-ed25519 SHA256:oNLu5tGVH56hsU+tyd/+7487yW0IYdeVRoC2SWyVSXY session=c4dfec6e
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: level=error msg=shell: failed to add agent socket: Failed to fetch instance "s2475755540" in project "default": Instance not found session=c4dfec6e
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: level=error msg=shell: exec failed: exec instance: Failed to fetch instance "s2475755540" in project "default": Instance not found session=c4dfec6e
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: panic: send on closed channel
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: goroutine 218 [running]:
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: ssh2incus/server.shellHandler.func3()
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]:         ssh2incus/server/shell.go:215 +0x4c
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]: created by ssh2incus/server.shellHandler in goroutine 228
Sep 06 07:25:12 instance-20230425-2252 ssh2incus[2302826]:         ssh2incus/server/shell.go:213 +0xdf0
Sep 06 07:25:12 instance-20230425-2252 systemd[1]: ssh2incus.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 06 07:25:12 instance-20230425-2252 systemd[1]: ssh2incus.service: Failed with result 'exit-code'.
Sep 06 07:25:15 instance-20230425-2252 systemd[1]: ssh2incus.service: Scheduled restart job, restart counter is at 1.
Sep 06 07:25:15 instance-20230425-2252 systemd[1]: Stopped SSH server for Incus instances.
Sep 06 07:25:15 instance-20230425-2252 systemd[1]: Started SSH server for Incus instances.
Sep 06 07:25:15 instance-20230425-2252 ssh2incus[2302910]: level=info msg=starting ssh2incus on :2222 as daemon, pid 2302910
Sep 06 07:25:15 instance-20230425-2252 ssh2incus[2302910]: level=error msg=delete instance s1622523035.u68a014b49d204e83cfe71be1 device ssh2incus-proxy-socket-186297a562fe48307w2qt: failed to get instance s1622523035.u68a014b49d204e83cfe71be1: Failed to fetch instance "s1622523035" in project "default": Instance not found
Sep 06 07:25:15 instance-20230425-2252 ssh2incus[2302910]: level=error msg=delete instance s2031031808.u68a014b49d204e83cfe71be1 device ssh2incus-proxy-socket-1862a61aefff0893dsfvn: failed to get instance s2031031808.u68a014b49d204e83cfe71be1: Failed to fetch instance "s2031031808" in project "default": Instance not found
Sep 06 07:25:15 instance-20230425-2252 ssh2incus[2302910]: level=error msg=delete instance s2031031808.u68a014b49d204e83cfe71be1 device ssh2incus-proxy-socket-1862a61d08643d89hyejl: failed to get instance s2031031808.u68a014b49d204e83cfe71be1: Failed to fetch instance "s2031031808" in project "default": Instance not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions