utils: Add option to run root shell on console
Some checks reported errors
Aimee OS/aimee-os/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
Aimee OS/aimee-os/pipeline/head Something is wrong with the build of this commit
Until I develop a captive portal-based mechanism for initially configuring the WiFi on Raspberry Pi machines, the easiest way to do initial provisioning is using the CLI via the serial console. Since the root account has no password, and I don't want to have to specify one in downstream projects' configurations, I've added a configuration option to enable automatically launching a root shell connected to the serial console instead of a login prompt. The security risks here are pretty minimal, because someone would need phyiscal access to the device in order to use this shell, in which case they could use any number of other methods to get control of the system.
This commit is contained in:
26
package/aimee-os-utils/root-shell@.service
Normal file
26
package/aimee-os-utils/root-shell@.service
Normal file
@@ -0,0 +1,26 @@
|
||||
[Unit]
|
||||
Description=root shell on %I
|
||||
After=sshd.service
|
||||
Conflicts=shutdown.target
|
||||
Conflicts=getty@%i.service serial-getty@%i.service
|
||||
|
||||
[Service]
|
||||
Type=idle
|
||||
Environment=TERM=linux
|
||||
ExecStart=/bin/sh
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
StandardInput=tty
|
||||
TTYPath=/dev/%I
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
KillMode=process
|
||||
IgnoreSIGPIPE=no
|
||||
KillSignal=SIGHUP
|
||||
|
||||
# Unset locale for the console getty since the console has problems
|
||||
# displaying some internationalized messages.
|
||||
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user