#!/bin/sh
# \
exec expect "$0" ${1+"$@"}
set username [lindex $argv 0]
spawn sudo -u $username ssh-keygen -t rsa
expect "Enter file in which to save the key"
send "\r"
expect "Enter passphrase"
send "\r"
expect "Enter same passphrase again"
send "\r"
expect eof
