Advertisement
Guest User

Centos 6 installation script

a guest
Jul 11th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. echo 'Adding DNS servers'
  2. echo 'DNS1=8.8.8.8' >> /etc/sysconfig/network-scripts/ifcfg-eth0
  3. echo 'DNS2=8.8.4.4' >> /etc/sysconfig/network-scripts/ifcfg-eth0
  4.  
  5. echo 'updateing yum'
  6. yum update -y
  7.  
  8. echo 'Installing Desktop (this can take a while)'
  9. yum groupinstall Desktop -y
  10.  
  11. echo 'Installing xfce4 & firefox (this can take a while)'
  12. yum install gnome-core xfce4 firefox -y
  13.  
  14. echo 'Installing tigervnc-server'
  15. yum install tigervnc-server -y
  16.  
  17. echo 'Installing sys admin utils'
  18. yum install curl -y
  19. yum install wget -y
  20.  
  21. echo 'removeing old java'
  22. yum remove java-1.6.0-openjdk -y
  23. yum remove java-1.7.0-openjdk -y
  24.  
  25. echo 'Fixing hostname'
  26. echo -e "127.0.0.1\t$( hostname | awk '{ print $1 }' )" >> /etc/hosts
  27.  
  28. echo 'install java8'
  29. wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
  30. rpm -ivh jdk-8u45-linux-x64.rpm
  31. export JAVA_HOME=/usr/java/jdk1.8.0_45/
  32. export PATH=$PATH:$JAVA_HOME
  33.  
  34. echo 'Open firewall for VNC'
  35. iptables -A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
  36. service iptables save
  37. service iptables restart
  38.  
  39. echo 'Install fail2ban for Centos 6'
  40. rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  41. yum install fail2ban -y
  42. cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
  43. service fail2ban restart
  44.  
  45. chkconfig vncserver on
  46.  
  47. echo 'please enter a vnc password'
  48. vncpasswd
  49.  
  50. echo 'VNCSERVERS="1:root"' > /etc/sysconfig/vncservers
  51. echo 'VNCSERVERARGS[1]="-geometry 1024x768"' >> /etc/sysconfig/vncservers
  52.  
  53. service vncserver restart
  54. pkill vnc
  55.  
  56. sed -i "s/twm/#twm/" ~/.vnc/xstartup
  57. echo 'exec gnome-session &' >> ~/.vnc/xstartup
  58.  
  59. service vncserver restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement