Skip to content

Instantly share code, notes, and snippets.

@mz0
Last active December 15, 2024 19:37
Show Gist options
  • Select an option

  • Save mz0/281d762000b1fd47ea1708b3efe98255 to your computer and use it in GitHub Desktop.

Select an option

Save mz0/281d762000b1fd47ea1708b3efe98255 to your computer and use it in GitHub Desktop.
Ubuntu 24.04 setting up user with systemd-homed
apt-cache policy systemd-homed
# systemd-homed: Candidate: 255.4-1ubuntu8.4
sudo apt install systemd-homed
# The following NEW packages installed: systemd-homed systemd-userdbd
sudo homectl --real-name=ZM \
--uid=60131 \
--kill-processes=false \
--member-of=docker,dip,lpadmin,plugdev,ops,sudo,users,wireshark \
--ssh-authorized-keys=@/path/to/zm.id_ed25519.pub \
--ssh-authorized-keys=@/path/to/zm.id2.pub \
--storage=luks \
--fs-type=ext4 \
--disk-size='1%' \
create zm
@mz0
Copy link
Author

mz0 commented Dec 14, 2024

~zm/.identity is:

{
	"disposition" : "regular",
	"killProcesses" : false,
	"lastChangeUSec" : 1734194292019323,
	"lastPasswordChangeUSec" : 1734194292019323,
	"memberOf" : [
		"dip",
		"docker",
		"lpadmin",
		"ops",
		"plugdev",
		"sudo",
		"users",
		"wireshark"
	],
	"perMachine" : [
		{
			"diskSize" : 4294967296,
			"fileSystemType" : "ext4",
			"matchMachineId" : "5f54cbef1f5a471f998071bda68c830e",
			"rebalanceWeight" : 0,
			"storage" : "luks"
		}
	],
	"privileged" : {
		"hashedPassword" : [
			"$y$j9T$Z8P0mhG9yfr/CyYwCtqqz1$fhMr/vJOmO2Dw3mcMtO3GKM1knDqXLUhfk5rqsxRIlA"
		],
		"sshAuthorizedKeys" : [
			"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA3MKStmrL917EbmLfM52LnmRiAmF5uhlYh7NAXvjRId m@pug",
			"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPpiIKXMXvxzYNRAJFNkVMJeeIN5pzvbJI9pf1dNNl9p m0@n13"
		]
	},
	"realName" : "ZM",
	"signature" : [
		{
			"data" : "jmXh81tFKQdC6lICvk//+DeJaXGjCDTLSKHRLHonlrVcehbz8Hzza+VcJVSOkpBjkju+npZtojzFb12L6YMiDg==",
			"key" : "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEASHLiXjYgRK8kN20vZnyfJfxKIT1MMr64nBi1mFUkDXI=\n-----END PUBLIC KEY-----\n"
		}
	],
	"uid" : 60131,
	"userName" : "zm"
}

@mz0
Copy link
Author

mz0 commented Dec 14, 2024

homectl create USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment