Guest User

Untitled

a guest
Nov 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #!/bin/bash
  2. read -p "Disable guest account? yes or no: " ans
  3. case "$ans" in
  4. yes) if locate /etc/lightdm/ |grep lightdm.conf
  5. then
  6. sed -i '$ a [SeatDefaults]' /etc/lightdm/lightdm.conf &&
  7. sed -i '$ a user-session=ubuntu' /etc/lightdm/lightdm.conf &&
  8. sed -i '$ a greeter-session=unity-greeter' &&
  9. sed -i '$ a allow-guest=false' /etc/lightdm/lightdm.conf &&
  10. echo "Guest account disabled succesfuly"
  11.  
  12. else cat > /etc/lightdm/lightdm.conf
  13. sed -i '$ a [SeatDefaults]' /etc/lightdm/lightdm.conf &&
  14. sed -i '$ a user-session=ubuntu' /etc/lightdm/lightdm.conf &&
  15. sed -i '$ a greeter-session=unity-greeter' &&
  16. sed -i '$ a allow-guest=false' /etc/lightdm/lightdm.conf && echo "Guest account disabled"
  17.  
  18. fi
  19. ;;
  20. no) echo "Will not disable guest account "
  21. esac
Add Comment
Please, Sign In to add comment