Copying a file from a remote server to local host via connection tunneling
I'm trying to copy a file from a server behind another server. Currently I'm using WinSCP in Windows in a Virtual Drive but it's super slow and I'd like to download the files onto my mac using terminal. I need to do a "forwarded connection".
So in terminal, using .ssh/config I log onto the first server:
ssh jump.serverexample.com
via port 22 using a username and password. This info I've saved in .ssh/config as so:
HostName jump.serverexample.com
Port 22
User user1
I then log into the second server behind this one using ProxyCommand having put the info into .shh/config:
Host hal.serverexample.com
ProxyCommand ssh jump.serverexample.com exec -W %h %p
Port 22
User user1
This all works fine and I'm into the hal computer. using CD I can navigate and see the file. I then try to get the file back to the folder 'sharing' on my macbook's desktop using this scp command:
scp -P 22 user1@hal.serverexample.com:folder1/folder2/folder3/file.txt /Users/user2/Desktop/sharing
It asks for my password (to the server), I put it in and then it prints:
/Users/user2/Desktop/sharing: No such file or directory
What am I doing wrong? My username on the servers is different to the username on my macbook.
ssh scp forwarding
|
show 1 more comment
I'm trying to copy a file from a server behind another server. Currently I'm using WinSCP in Windows in a Virtual Drive but it's super slow and I'd like to download the files onto my mac using terminal. I need to do a "forwarded connection".
So in terminal, using .ssh/config I log onto the first server:
ssh jump.serverexample.com
via port 22 using a username and password. This info I've saved in .ssh/config as so:
HostName jump.serverexample.com
Port 22
User user1
I then log into the second server behind this one using ProxyCommand having put the info into .shh/config:
Host hal.serverexample.com
ProxyCommand ssh jump.serverexample.com exec -W %h %p
Port 22
User user1
This all works fine and I'm into the hal computer. using CD I can navigate and see the file. I then try to get the file back to the folder 'sharing' on my macbook's desktop using this scp command:
scp -P 22 user1@hal.serverexample.com:folder1/folder2/folder3/file.txt /Users/user2/Desktop/sharing
It asks for my password (to the server), I put it in and then it prints:
/Users/user2/Desktop/sharing: No such file or directory
What am I doing wrong? My username on the servers is different to the username on my macbook.
ssh scp forwarding
You're running scp on your local mac? The error message just says that the directory/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).
– Kenster
Feb 18 at 21:33
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40
|
show 1 more comment
I'm trying to copy a file from a server behind another server. Currently I'm using WinSCP in Windows in a Virtual Drive but it's super slow and I'd like to download the files onto my mac using terminal. I need to do a "forwarded connection".
So in terminal, using .ssh/config I log onto the first server:
ssh jump.serverexample.com
via port 22 using a username and password. This info I've saved in .ssh/config as so:
HostName jump.serverexample.com
Port 22
User user1
I then log into the second server behind this one using ProxyCommand having put the info into .shh/config:
Host hal.serverexample.com
ProxyCommand ssh jump.serverexample.com exec -W %h %p
Port 22
User user1
This all works fine and I'm into the hal computer. using CD I can navigate and see the file. I then try to get the file back to the folder 'sharing' on my macbook's desktop using this scp command:
scp -P 22 user1@hal.serverexample.com:folder1/folder2/folder3/file.txt /Users/user2/Desktop/sharing
It asks for my password (to the server), I put it in and then it prints:
/Users/user2/Desktop/sharing: No such file or directory
What am I doing wrong? My username on the servers is different to the username on my macbook.
ssh scp forwarding
I'm trying to copy a file from a server behind another server. Currently I'm using WinSCP in Windows in a Virtual Drive but it's super slow and I'd like to download the files onto my mac using terminal. I need to do a "forwarded connection".
So in terminal, using .ssh/config I log onto the first server:
ssh jump.serverexample.com
via port 22 using a username and password. This info I've saved in .ssh/config as so:
HostName jump.serverexample.com
Port 22
User user1
I then log into the second server behind this one using ProxyCommand having put the info into .shh/config:
Host hal.serverexample.com
ProxyCommand ssh jump.serverexample.com exec -W %h %p
Port 22
User user1
This all works fine and I'm into the hal computer. using CD I can navigate and see the file. I then try to get the file back to the folder 'sharing' on my macbook's desktop using this scp command:
scp -P 22 user1@hal.serverexample.com:folder1/folder2/folder3/file.txt /Users/user2/Desktop/sharing
It asks for my password (to the server), I put it in and then it prints:
/Users/user2/Desktop/sharing: No such file or directory
What am I doing wrong? My username on the servers is different to the username on my macbook.
ssh scp forwarding
ssh scp forwarding
edited Feb 18 at 21:30
Kenster
4,93022034
4,93022034
asked Feb 18 at 17:14
TobyBTobyB
112
112
You're running scp on your local mac? The error message just says that the directory/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).
– Kenster
Feb 18 at 21:33
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40
|
show 1 more comment
You're running scp on your local mac? The error message just says that the directory/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).
– Kenster
Feb 18 at 21:33
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40
You're running scp on your local mac? The error message just says that the directory
/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).– Kenster
Feb 18 at 21:33
You're running scp on your local mac? The error message just says that the directory
/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).– Kenster
Feb 18 at 21:33
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40
|
show 1 more 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%2f1407102%2fcopying-a-file-from-a-remote-server-to-local-host-via-connection-tunneling%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%2f1407102%2fcopying-a-file-from-a-remote-server-to-local-host-via-connection-tunneling%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
You're running scp on your local mac? The error message just says that the directory
/Users/user2/Desktop/sharing
doesn't exist on the local system (whatever host you're running scp on).– Kenster
Feb 18 at 21:33
The destination folder exists on the MacBook. I’ve tried initiating the SCP command to retrieve the file when logged into hal.serverexample.com. I’ve also tried calling the SCP command after entering the first server via ssh (jump.serverexample.com). However, this also has the same outcome. Could it be a firewall on my router stopping the sending the file back? Or do I need to specify my username and IP address prior to the local location information in the SCP command?
– TobyB
Feb 19 at 14:14
"Could it be a firewall on my router stopping the sending the file back?" No. What host are you running scp on when you get this error?
– Kenster
Feb 19 at 14:33
When you type in the scp command and hit return, which computer (of the three) is actually running the scp program?
– Kenster
Feb 19 at 14:37
I've tried jump and hal as the computers running the SCP command.
– TobyB
Feb 19 at 14:40