Add regular user spark and clone-sparkos.sh script, default to non-root login

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 15:55:25 +00:00
parent 5f366534aa
commit e1acbfc231
10 changed files with 250 additions and 12 deletions

View File

@@ -1 +1,3 @@
root:x:0:
spark:x:1000:
sudo:x:27:spark

View File

@@ -1 +1,2 @@
root:x:0:0:root:/root:/bin/sh
spark:x:1000:1000:SparkOS User:/home/spark:/bin/sh

View File

@@ -2,9 +2,15 @@
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PS1='SparkOS:\w\$ '
export HOME=/root
export TERM=linux
# Set HOME based on user
if [ "$(id -u)" = "0" ]; then
export HOME=/root
else
export HOME=/home/$(whoami)
fi
# Welcome message
echo "Welcome to SparkOS!"
echo "Type 'help' for available commands"

15
rootfs/etc/sudoers Normal file
View File

@@ -0,0 +1,15 @@
# SparkOS Sudoers Configuration
# Allow spark user to run any command without password
# Default settings
Defaults env_reset
Defaults secure_path="/bin:/sbin:/usr/bin:/usr/sbin"
# Root can run anything
root ALL=(ALL:ALL) ALL
# Spark user can run anything without password
spark ALL=(ALL:ALL) NOPASSWD: ALL
# Include sudoers.d directory
@includedir /etc/sudoers.d