Skip to content

Instantly share code, notes, and snippets.

@apivovarov
Created June 12, 2024 23:21
Show Gist options
  • Save apivovarov/158902525fea1230e444e45aff6a5f23 to your computer and use it in GitHub Desktop.
Save apivovarov/158902525fea1230e444e45aff6a5f23 to your computer and use it in GitHub Desktop.
start-docker as user
docker run -ti --name u2204 -v ~/workspace:/home/joshcao/workspace ubuntu:22.04
U=pivovaa
apt update
apt install -y adduser sudo vim wget curl \
libssl-dev \
python3 python3-pip
adduser $U
usermod -aG sudo $U
visudo (add NOPASSWD: to Line 50)
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
cp /root/.bashrc /root/.profile /home/$U/
chown $U /home/$U/.bashrc /home/$U/.profile
su - $U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment