Advertisement
Guest User

Untitled

a guest
May 5th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #!/usr/local/bin/expect -f
  2.  
  3. spawn adduser
  4. expect "Username:"
  5. send "[lindex $argv 0]\r"
  6. expect "Full name:"
  7. send "[lindex $argv 1]\r"
  8. expect "Uid (Leave empty for default):"
  9. send "\r"
  10. expect "Login group"
  11. send "clients\r"
  12. expect "Login group is clients."
  13. send "\r"
  14. expect "Login class"
  15. send "\r"
  16. expect "Shell"
  17. send "rssh\r"
  18. expect "Home Directory \[/home/[lindex $argv 0]\]:"
  19. send "\/usr\/local\/www\/[lindex $argv 0]\r"
  20. expect "Home Directory Permissions"
  21. send "\r"
  22. expect "Use password-based authentication"
  23. send "\r"
  24. expect "Use an empty password"
  25. send "no\r"
  26. expect "Use a random password"
  27. send "no\r"
  28. expect "Enter password:"
  29. send "[lindex $argv 2]\r"
  30. expect "Enter password again:"
  31. send "[lindex $argv 2]\r"
  32. expect "Lock out the account after creation"
  33. send "no\r"
  34. expect "OK?"
  35. send "yes\r"
  36. expect "Add another user"
  37. send "no\r"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement