Homelab

    ArchLinux Configuration

    I've installed cockpit, which turns out to be a fantastic tool1, I still want to setup ssh so that I can use TRAMP to edit files remotely. Also, I will probably uninstall cockpit because what I need can be achieved via ssh.

    I'm even thinking about running an Emacs daemon on the server and see how feasible it is to use that for certain things.

    Add a non-root user

    By default sshd doesn't allow root to do a password login via ssh. Also, it's always a good idea to create a separate user for regular adminstration.

    sudo useradd -m john
    

    and set the password

    passwd john
    

    Copy ssh key to the server

    Nobody uses password login to ssh. Nobody should. So let's copy the ssh key.

    ssh-copy-id john@<ip>
    

    Sudo

    Install vim (or vi) to edit the sudoers file.

    EDITOR=vim visudo
    

    Scroll down to the bottom of the file and grant all permissions to this guy:

    john ALL=(ALL:ALL) ALL
    

    Close the file with :wq.

    If using docker

    Add the user to docker group

    gpasswd -a john <group>
    

    Keep it on when the lid is closed

    It's possible to change the behaviour by setting the ACPI event action which is managed by logind, a systemd native service2. Edit the logind.conf file:

    vim /etc/systemd/logind.conf
    

    Find the HandleLidSwitch event handler and set the action to ignore.

    HandleLidSwitch=ignore
    

    Then restart logind:

    systemctl kill -s HUP systemd-logind
    

    Works like a charm!

    3

    I was also using a very slow DSL line which was metered. It capped to 128kbps if you hit daily quota. 4: That holds true even today. 5: But not confident enough to fully eschew it. 1: It reminds me of Webmin and other tools from the past and makes me slightly nostalgic. 2: https://wiki.archlinux.org/title/Power_management#ACPI_events