SSH into installed image

I’m a bit new to installing a Guix system from scratch and wanted to try it out in a VM first. I created the VM like this:

> wget https://github.com/SystemCrafters/guix-installer/releases/download/v202411080129/guix-installer-202411080129.iso
> qemu-img create -f qcow2 guix-system.img 100G
> qemu-system-x86_64 -m 1024 -smp 1 -enable-kvm -boot menu=on,order=d -drive file=guix-system.img -nic user,model=virtio-net-pci,hostfwd=tcp::10022-:22 -drive media=cdrom,file=guix-installer-202411080129.iso

I went through the graphical installer just fine and can reboot without the media=cdrom,file... argument. I can then log in too. I check to see if the ssh daemon is running and it appears to be:

> sudo herd status sshd
Status of ssh-daemon:
  It is running since 10:05:43 AM (10 minutes ago)
  Running value is ("<input-output: socket 26>" "#<input-output: socket 27>")
  It is enabled.
  Provides (ssh-daemon ssh sshd).
  Requires (pam syslogd loopback networking).
  Will be respawned.

However when I try to ssh from my host to the guest I get a failure:

# Host: 
> ssh -p 10022 admin@localhost

On the Guix Guest:

localhost sshd-session[234]: error: maximum authentication attempts exceeded for admin from 10.2.2.2 port 43042 ssh2 [preauth]

I’d imagine this is an issue with ssh daemon configuration since sshd_config doesn’t seem to appear in /etc/ssh.

So I guess my question is, if this is the case, how do I include that config in the install config in case I want to deploy other Guix VM’s and ssh into them?

Thanks

Ah, just found the herd configuration sshd command. The MaxAuthTries is not in the default config there. The default from man sshd_config says it is 6. I’m getting this max try error after the first try from a newly installed system.

Maybe limit your SSH login to password only as possibly you have some SSH keys in your agent and all the tried keys count as tries.

Gah! That must have been it. Why is that though, especially on a new install?

For anyone wondering I ended up adding this to my config:

           (service openssh-service-type
                    (openssh-configuration
                     (port-number 22)
                     (use-pam? #t)
                     (public-key-authentication? #f)
                     (log-level 'debug)
                     (extra-content "\
MaxAuthTries 10
                                    ")
                     ))
1 Like