mirror of
https://github.com/johndoe6345789/SparkOS.git
synced 2026-04-24 13:34:56 +00:00
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:
@@ -1 +1,3 @@
|
||||
root:x:0:
|
||||
spark:x:1000:
|
||||
sudo:x:27:spark
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
root:x:0:0:root:/root:/bin/sh
|
||||
spark:x:1000:1000:SparkOS User:/home/spark:/bin/sh
|
||||
|
||||
@@ -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
15
rootfs/etc/sudoers
Normal 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
|
||||
Reference in New Issue
Block a user