I am trying to rsync a directory from a remote machine to my laptop. The directory on the remote machine is not owned by the ssh user, hence I am trying to use
sudo as explained here
Both machines are running macOS and have both
XQuartz installed. X11Forwarding is working correctly, which I tested by running
xeyes on the remote machine via SSH. The following command opened the window on my local machine.
ssh -X remotehost /opt/X11/bin/xeyes
But when I run
ssh-askpass on the remote machine, the prompt is opening on the remote machine, instead of forwarding it to the local machine.
ssh -X remotehost 'export SUDO_ASKPASS=/usr/local/bin/ssh-askpass; env; sudo -A ls'
Why isn't the
ssh-askpass prompt forwarded to my local machine?
On Local Machine
$ echo $DISPLAY /private/tmp/com.apple.launchd.pHs2JQL4YE/org.macosforge.xquartz:0
On Remote Machine
$ env | fgrep DISPLAY DISPLAY=<remote machine hostname>:10.0 $ sudo env | fgrep DISPLAY Password: DISPLAY=<remote machine hostname>:10.0