What is the default username and password for the most recent raspberry pi image? i see root and nixos in /etc/passwd but i don’t know the password. i also don’t have a micro hdmi yet to use.
if you followed the guide and ran nixos-rebuild switch then your username is whatever you set in the config:
let
user = "guest";
password = "guest";
You can run sudo -i to get a root shell as stated in the nix.dev tutorial if you haven’t yet installed. But I gather you’re trying to ssh in since you don’t have a HDMI cable? in any case, sudo -i should work for what you need
that is if you have a monitor connected to the raspberrypi.
power it on.
You should be greeted with a fresh shell!
you will be automatically logged in. i have not logged in to it at all. i am trying to ssh into it because i don’t have a monitor and a micro hdmi cable.
right, sshd isn’t started by default. I’m not sure if the serial console (UART) is enabled by default either but that would require a different cable. Worth a shot if you have one.
If you would like to continue the installation from a different machine you can use activated SSH daemon. You need to copy your ssh key to either /home/nixos/.ssh/authorized_keys or /root/.ssh/authorized_keys (Tip: For installers with a modifiable filesystem such as the sd-card installer image a key can be manually placed by mounting the image on a different machine). Alternatively you must set a password for either root or nixos with passwd to be able to login.
it seems its sshd is enabled because it asks me to enter username and password. (even though the guide instructs about enabling ssh, inferring that it is not enabled )
Yep, you are correct. sd image have it enabled and you’re clearly seeing it work. That nix.dev doc should be updated perhaps. See my edits above. It’s just a matter of mounting the sd card and copying your keys
it is still asking for password even if i explicitly indicate a private key.
i could disable password authentication in /etc/ssh/ssh_config, but that is a symlink to configuration in /nix/store.
i don’t know exactly what these hashed things are but i am guessing that they are generated using nixos-rebuild switch, which i can’t do since i can’t even authenticate.
am i right?
Could someone clarify - how exactly I should put this authorized_keys to SD media?
I flash it with the pre-made minimal .iso image, so no rw partitions exist there by default, right?
Where should I put the file then?
Here’s some config for references for ssh with (replace variables in UPPERCASE with your own):
- password authentication disabled
- ed25519 keys accepted only
- non-default 22 port