SUDO_ASKPASS prompt is opening on remote machine
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 ssh-askpass and 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?
Update
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
ssh x11-forwarding
add a comment |
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 ssh-askpass and 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?
Update
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
ssh x11-forwarding
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45
add a comment |
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 ssh-askpass and 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?
Update
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
ssh x11-forwarding
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 ssh-askpass and 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?
Update
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
ssh x11-forwarding
ssh x11-forwarding
edited Jan 20 at 3:45
Joyce Babu
asked Jan 19 at 14:45
Joyce BabuJoyce Babu
200315
200315
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45
add a comment |
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396089%2fsudo-askpass-prompt-is-opening-on-remote-machine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396089%2fsudo-askpass-prompt-is-opening-on-remote-machine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is the value of the DISPLAY environment variable on the remote system? And what is the value of DISPLAY for commands run via sudo?
– Kenster
Jan 19 at 23:50
@Kenster I have added the details to the question.
– Joyce Babu
Jan 20 at 3:45