Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoCo image: Improve example user creation #669

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions examples/example_confidential_image/setup_debian_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,26 @@ update-initramfs -u
ssh-keygen -A

### Example to add a user with sudo right
#useradd -m -s /bin/bash username
#echo 'username:password' | chpasswd
#usermod -aG sudo username

#USER="username"
#PASSWORD="password"
#SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArQslTrAf9A... user@example.com"

## Create a new user with a home directory and Bash shell
#useradd -m -s /bin/bash "$USER"
#
## Set the user's password
#echo "$USER:$PASSWORD" | chpasswd
#
## Add the user to the sudo group
#usermod -aG sudo "$USER"
#
## Install ssh key
#USER_HOME="/home/$USER"
#mkdir -p "$USER_HOME/.ssh"
#chmod 700 "$USER_HOME/.ssh"
#echo "$SSH_KEY" >> "$USER_HOME/.ssh/authorized_keys"
#chmod 600 "$USER_HOME/.ssh/authorized_keys"
#chown -R $USER:$USER "$USER_HOME/.ssh"

### END example
umount /tmp
Loading