* delete some kerberos-related lines
* don't default to root for ssh'ing
* set an environment variable to indicate running under sshroot
* allowing passing arguments to the shell subcommand
* display the command being run
#!/bin/bash
-export KRB5CCNAME=/tmp/krb5cc_$(id -u).root
-export KRBTKFILE=/dev/null
# lifetime, in minutes
lifetime=15
{
unset SSH_AUTH_SOCK SSH_AGENT_PID
eval $(keychain --timeout $lifetime --eval --host "$hostopt-root" $keys)
+ export SSHROOT=1
exec "$@"
}
{
unset SSH_AUTH_SOCK SSH_AGENT_PID
eval $(keychain --timeout $lifetime --eval --host "$hostopt-root")
+ export SSHROOT=1
+ echo with-agent: Running: "$@"
exec "$@"
}
with-agent ssh-add -D
;;
shell)
- with-keys $SHELL
+ with-keys "$SHELL" "$@"
;;
ssh)
- with-keys ssh -l root "$@"
+ #with-keys ssh -l root "$@"
+ with-keys ssh "$@"
;;
*)
if [ -z "$command" ]; then