Advertisement
Guest User

Untitled

a guest
Feb 28th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #! /bin/sh
  2. PASSWORD="somepass"
  3. LN=$'\n'
  4. cat <<EOF > /etc/init.d/ssh_installer
  5. #! /bin/sh
  6. case "\$1" in
  7.   start)
  8.     yum -y install openssh-server
  9.     /sbin/service sshd start
  10.     passwd << EOF
  11. $PASSWORD
  12. $PASSWORD${LN}EOF
  13. esac
  14. EOF
  15.  
  16. chmod a+x /etc/init.d/ssh_installer
  17. ln -s ../init.d/ssh_installer etc/rc3.d/S99ssh_installer
  18. ln -s ../init.d/ssh_installer etc/rc5.d/S99ssh_installer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement