Skip to content

Commit d595356

Browse files
committed
chore: change username to 'user', remove default ssh public key
1 parent 1b93823 commit d595356

3 files changed

Lines changed: 20 additions & 23 deletions

File tree

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ This repo contains the code to get NixOS running on LicheePi 4A.
44

55
![neofetch](./_img/nixos-licheepi-fastfetch.png)
66

7-
Default user: `lp4a`, default password: `lp4a`.
7+
### Default login (development image)
8+
9+
| | |
10+
| --- | --- |
11+
| User | `user` |
12+
| Password | `lp4a` |
13+
14+
Change the password and SSH settings before exposing the board to any network you do not fully trust.
815

916
## Build u-boot & sdImage
1017

@@ -67,10 +74,10 @@ Then, use the following command to flash the image into the board's eMMC:
6774

6875
```bash
6976
# upload the sdImage to the NixOS system on the board
70-
scp nixos-lp4a.img lp4a@<ip-of-your-board>:~/
77+
scp nixos-lp4a.img user@<ip-of-your-board>:~/
7178

7279
# login to the board via ssh or serial port
73-
ssh lp4a@<ip-of-your-board>
80+
ssh user@<ip-of-your-board>
7481

7582
# check all the block devices
7683
# you should see mmcblk0(eMMC) & mmcblk1(SD card)

demo/user-group.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# NOTE: make sure to update your password and public key in this file
2-
# NOTE: to generate a hashed password, you can use the `mkpasswd` command.
1+
# Default account: Unix user `user`, password lp4a (see README.md).
2+
# Public key below is a valid-format placeholder; the private key is not in this repo — replace
3+
# with your own `ssh-ed25519` line (from ~/.ssh/id_ed25519.pub or similar) before relying on SSH keys.
4+
# To generate a new hashed password: `mkpasswd`.
35

46
let
5-
username = "lp4a";
7+
username = "user";
68
hostname = "licheepi4a";
7-
# default password is "lp4a"
89
hashedPassword = "$y$j9T$mTIe/80yqh53danHYbUkP1$2TYCUsFKnkBnHG6pArOv9t.e2ofxO.j1MIt/6rB05P1";
9-
# default public key is my own, change it to your own public key!
10-
publickey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfKhCawAW4dQz5OtDGZIlKvuNx3+Iovw5X/251Wfxnq user@dev";
10+
# Placeholder only (no matching private key shipped here).
11+
publickey = "ssh-ed25519 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX demo-placeholder-replace-me";
1112
in
1213
{
1314
networking.hostName = hostname;
@@ -28,7 +29,6 @@ in
2829
];
2930
};
3031

31-
# also add public key to root user
3232
users.users.root.openssh.authorizedKeys.keys = [
3333
publickey
3434
];

modules/user-group.nix

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# NOTE: make sure to update your password and public key in this file
2-
# NOTE: to generate a hashed password, you can use the `mkpasswd` command.
1+
# Default account: Unix user `user`, password lp4a (see README.md).
2+
# Add SSH keys under users.users.<name>.openssh.authorizedKeys.keys if you want key login.
3+
# To generate a new hashed password: `mkpasswd`.
34

45
let
56
username = "user";
67
hostname = "licheepi4a";
7-
# default password is "lp4a"
88
hashedPassword = "$y$j9T$mTIe/80yqh53danHYbUkP1$2TYCUsFKnkBnHG6pArOv9t.e2ofxO.j1MIt/6rB05P1";
9-
# default public key is my own, change it to your own public key!
10-
publickey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfKhCawAW4dQz5OtDGZIlKvuNx3+Iovw5X/251Wfxnq user@dev";
119
in {
1210
networking.hostName = hostname;
1311

@@ -17,13 +15,5 @@ in {
1715
isNormalUser = true;
1816
home = "/home/${username}";
1917
extraGroups = ["users" "networkmanager" "wheel" "docker"];
20-
openssh.authorizedKeys.keys = [
21-
publickey
22-
];
2318
};
24-
25-
# also add public key to root user
26-
users.users.root.openssh.authorizedKeys.keys = [
27-
publickey
28-
];
2919
}

0 commit comments

Comments
 (0)