This commit is contained in:
Luk Lu
2019-09-24 19:48:08 +08:00
parent d2e1061276
commit 3d5c09c5cf
5 changed files with 55 additions and 4 deletions

35
setup-debian.sh Normal file
View File

@@ -0,0 +1,35 @@
echo "Usage: setup.sh [USER]"
echo "Example: setup.sh alice"
if [ v$1 != v ]
then
export User=$1
else
export User=adot
fi
apt update
apt install -y emacs git curl screen sudo automake
echo ">>> Change root password"
passwd
echo ">>> add a new user"
useradd $User
usermod -a -G sudo $User
passwd $User
emacs /etc/passwd
mkdir /home/$User
chown $User:$User /home/$User
echo ">>> allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL"
chmod o+w /etc/sudoers
emacs /etc/sudoers
chmod o-w /etc/sudoers
echo ">>> disallow root login: #PermitRootLogin yes"
emacs /etc/ssh/sshd_config
service sshd restart
echo ">>> configure locales: install all-locales, default to zh-CN.UTF-8"
dpkg-reconfigure locales