-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd83c7e
commit 2764c25
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[Service] | ||
ExecStart= | ||
ExecStart=-/sbin/agetty --autologin ovos --noclear %I 38400 linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,14 @@ if [ "$USER" != "pi" ]; then | |
# 7. Add the new user to the sudo group | ||
echo "Adding $USER to the sudo group..." | ||
sed -i "/^sudo:/s/pi/$USER/" /etc/group | ||
|
||
# 8. Allow autologin of user | ||
echo "Creating autologin for $USER" | ||
# NOTE: Not sure that the link is needed | ||
ln -fs /lib/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/[email protected] | ||
cp -v /mounted-github-repo/autologin.conf /etc/systemd/system/[email protected]/autologin.conf | ||
sed -i "s/\bovos\b/${USER}/g" /etc/systemd/system/[email protected]/autologin.conf | ||
|
||
|
||
echo "User has been renamed, added to sudo group, and password updated." | ||
fi | ||
|
@@ -89,4 +97,4 @@ chown root:root /var/lib/systemd/linger/$USER | |
chmod 644 /var/lib/systemd/linger/$USER | ||
|
||
echo "Cleaning up apt packages..." | ||
apt-get --purge autoremove -y && apt-get clean | ||
apt-get --purge autoremove -y && apt-get clean |