#!/bin/sh # To allow autofs+sshfs to use a non-root user's ssh keys # put this in /usr/local/bin/sudo_ssh_username # and set things to match in the auto.ssh_username script # Both -H and -i are needed to give ssh the environment it needs/expects # On my system, things like # sudo -i -u username ls / # produce the output 'cannot execute binary file' # but running a script works # Once we've run ssh this way, we need to make sure # that we know what display, ssh-askpass, and ssh-agent to use # so sudo_ssh_workarounds finds them sudo -H -i -u username /usr/local/bin/sudo_ssh_workarounds "$@"