From 83073675460738030c42ad0b9984dd68b63a2817 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Mon, 12 Mar 2012 14:37:13 -0400 Subject: [PATCH] sshroot: minor cleanup, feature, and bugfixes * 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 --- sshroot | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sshroot b/sshroot index 97ae2ea..5c41dfa 100755 --- a/sshroot +++ b/sshroot @@ -1,6 +1,4 @@ #!/bin/bash -export KRB5CCNAME=/tmp/krb5cc_$(id -u).root -export KRBTKFILE=/dev/null # lifetime, in minutes lifetime=15 @@ -14,6 +12,7 @@ function with-keys { unset SSH_AUTH_SOCK SSH_AGENT_PID eval $(keychain --timeout $lifetime --eval --host "$hostopt-root" $keys) + export SSHROOT=1 exec "$@" } @@ -21,6 +20,8 @@ function with-agent { unset SSH_AUTH_SOCK SSH_AGENT_PID eval $(keychain --timeout $lifetime --eval --host "$hostopt-root") + export SSHROOT=1 + echo with-agent: Running: "$@" exec "$@" } @@ -43,10 +44,11 @@ case "$command" in 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 -- 2.34.1