Skip to content

Commit

Permalink
CoCo image: Improve example user creation (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
olethanh authored Aug 16, 2024
1 parent 902cf85 commit 1af9c75
Showing 1 changed file with 22 additions and 4 deletions.
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... [email protected]"

## 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

0 comments on commit 1af9c75

Please sign in to comment.