Skip to content

Instantly share code, notes, and snippets.

@kartben
Last active March 30, 2016 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartben/b5efcf5214e96542cfccbf0221a78eac to your computer and use it in GitHub Desktop.
Save kartben/b5efcf5214e96542cfccbf0221a78eac to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt-get update
sudo apt-get -y install --no-install-recommends \
openssh-server \
sudo \
procps \
wget \
unzip \
git \
ca-certificates \
maven \
curl && \
sudo mkdir /var/run/sshd && \
sudo sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
sudo echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
CHECK_UID=$(grep 'x:1000:' /etc/passwd)
if [ ! "${CHECK_UID}" ]; then
sudo useradd -u 1000 -G users,sudo -d /home/user --shell /bin/bash -m user
else
echo "User with ID 1000 already exists. Skipping user creation"
fi
# Install latest Node + npm
curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get install -y nodejs build-essential
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment