1
1
Fork 0

added a couple of stuff to prep script

This commit is contained in:
david 2012-06-27 11:22:02 +02:00
parent 9959d17a14
commit 1fc84a38d9
1 changed files with 49 additions and 5 deletions

View File

@ -1,10 +1,20 @@
#!/bin/bash
#preperation script for my ubuntu servers
# # # # # # # # # # # # # # # # # # # # # # # # # #
# preperation script for my ubuntu servers #
# can be used as firstboot script for vm-builder #
# # # # # # # # # # # # # # # # # # # # # # # # # #
# **** configuration section ****
sshgroup="sshusers"
#user=$(cat /etc/passwd | grep 1000)
#user=${user:0:$(($(echo `expr index "$user" :`)-1))}
user="david"
#install various tools/packages
# **** install various tools/packages ****
pkginstall()
{
@ -17,7 +27,7 @@ pkginstall()
}
#configure motd
# **** configure motd ****
motdconfig()
{
@ -26,14 +36,48 @@ motdconfig()
echo ""
read -p "now its time to create/customize your /etc/motd.tail
(http://www.network-science.de/ascii/)"
(go to http://www.network-science.de/ascii/)"
vi /etc/motd.tail
}
# **** ssh server config ****
sshdconfig()
{
echo "
__.-._
'-._'7'
/'.-c
| /T
_)_/LI
this machine is
protected by a
master of the force!
" > /etc/issue.net
sed -i 's/#Banner/Banner/' /etc/ssh/sshd_config
echo "" >> /etc/ssh/sshd_config
echo "# Restrictions added by ubuntu server prep script" >> /etc/ssh/sshd_config
echo "AllowGroups $sshgroup" >> /etc/ssh/sshd_config
echo "" >> /etc/ssh/sshd_config
addgroup $sshgroup
adduser $user $sshgroup
}
# **** start of script ****
pkginstall
motdconfig
sshdconfig
exit 0
# **** end of file ****
#end of file