forked from kn-winter/pi3-seafile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·37 lines (27 loc) · 901 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
USER=myuser # CHANGE THIS
VIMRC_LOCAL=/etc/vim/vimrc.local
apt-get update
apt-get -y dist-upgrade
sudo apt install vim
# Setup VIM
echo "syn on" > $VIMRC_LOCAL
echo "set background=dark" >> $VIMRC_LOCAL
echo "colorscheme elflord" >> $VIMRC_LOCAL
# Enable ssh for remote management
systemctl enable ssh
systemctl start ssh
# Change PermitRootLogin to no
####################
# Change umask to more secure setting
sed -i "s/UMASK[\t ]*022/UMASK 027/g" /etc/login.defs
# Add user
useradd -m $USER
usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio $USER
# TO DO, CHANGE USER PASSWORD
# Remove nopassword sudoers
rm /etc/sudoers.d/010_pi-nopasswd
# Set auto logout to 10 minutes
echo "TMOUT=600" > /etc/profile.d/auto_logout.sh
echo "readonly TMOUT" >> /etc/profile.d/auto_logout.sh
echo "export TMOUT" >> /etc/profile.d/auto_logout.sh