Skip to content

Instantly share code, notes, and snippets.

@Hacksore
Created March 27, 2015 12:44
Show Gist options
  • Save Hacksore/a2f09fb5e87475d5d271 to your computer and use it in GitHub Desktop.
Save Hacksore/a2f09fb5e87475d5d271 to your computer and use it in GitHub Desktop.
Set vncpasswd with expect to remove the need for user input. Useful for automation scripts such as provisioning.
#!/usr/bin/expect
set PASS [lindex $argv 0];
spawn vncpasswd
expect "Password: "
send "$PASS\r"
expect "Verify: "
send "$PASS\r"
expect "Would you like to enter a view-only password (y/n)? "
send "n\r"
expect eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment