How to copy files from a double remote server on a local machine
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have some files on a server that I'd like to copy on my local machine. The problem is that I can't directly connect to the remote machine, so I need to connect to an intermediate server first, then I can connect to the destination server via the intermediate one. Is there any way to copy the files directly from the destination server to the local machine and somehow bypass the intermediate server?
Thanks
scp remote ssh-tunneling sftp
add a comment |Â
up vote
0
down vote
favorite
I have some files on a server that I'd like to copy on my local machine. The problem is that I can't directly connect to the remote machine, so I need to connect to an intermediate server first, then I can connect to the destination server via the intermediate one. Is there any way to copy the files directly from the destination server to the local machine and somehow bypass the intermediate server?
Thanks
scp remote ssh-tunneling sftp
How are you connecting to the intermediate? If you are usingssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.
â B Layer
Oct 16 '17 at 10:11
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have some files on a server that I'd like to copy on my local machine. The problem is that I can't directly connect to the remote machine, so I need to connect to an intermediate server first, then I can connect to the destination server via the intermediate one. Is there any way to copy the files directly from the destination server to the local machine and somehow bypass the intermediate server?
Thanks
scp remote ssh-tunneling sftp
I have some files on a server that I'd like to copy on my local machine. The problem is that I can't directly connect to the remote machine, so I need to connect to an intermediate server first, then I can connect to the destination server via the intermediate one. Is there any way to copy the files directly from the destination server to the local machine and somehow bypass the intermediate server?
Thanks
scp remote ssh-tunneling sftp
asked Oct 16 '17 at 10:05
Eman
31
31
How are you connecting to the intermediate? If you are usingssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.
â B Layer
Oct 16 '17 at 10:11
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21
add a comment |Â
How are you connecting to the intermediate? If you are usingssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.
â B Layer
Oct 16 '17 at 10:11
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21
How are you connecting to the intermediate? If you are using
ssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.â B Layer
Oct 16 '17 at 10:11
How are you connecting to the intermediate? If you are using
ssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.â B Layer
Oct 16 '17 at 10:11
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
Going the direct route is probably not possible. But if you are able to log into the intermediate with ssh
and then from there log into the remote with ssh
then you can use something called local port forwarding to copy the files on your local machine with scp
. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate.
Try the following on two separate terminals (command lines, shells, etc.)
Terminal 1:
# set up 'local port forwarding'
ssh -v -T -N -L 2222:remote:22 username@intermediate
Terminal 2:
# do your scp command(s) like this example
scp -P 2222 localhost:/path/to/file .
Substitute appropriate hostnames or IP addresses for remote and intermediate.
In the scp
command /path/to/file
is the path on the remote server.
add a comment |Â
up vote
1
down vote
You don't need port forwarding, you can do it with ProxyCommand
. Add something like this to ~/.ssh/config
:
Host some_name
Hostname internal.example.com
User internal_user
ProxyCommand ssh -A -q -l %r -W %h:%p external.example.com
This will allow you to ssh
to the internal machine with ssh some_name
, use scp
, etc.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Going the direct route is probably not possible. But if you are able to log into the intermediate with ssh
and then from there log into the remote with ssh
then you can use something called local port forwarding to copy the files on your local machine with scp
. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate.
Try the following on two separate terminals (command lines, shells, etc.)
Terminal 1:
# set up 'local port forwarding'
ssh -v -T -N -L 2222:remote:22 username@intermediate
Terminal 2:
# do your scp command(s) like this example
scp -P 2222 localhost:/path/to/file .
Substitute appropriate hostnames or IP addresses for remote and intermediate.
In the scp
command /path/to/file
is the path on the remote server.
add a comment |Â
up vote
0
down vote
accepted
Going the direct route is probably not possible. But if you are able to log into the intermediate with ssh
and then from there log into the remote with ssh
then you can use something called local port forwarding to copy the files on your local machine with scp
. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate.
Try the following on two separate terminals (command lines, shells, etc.)
Terminal 1:
# set up 'local port forwarding'
ssh -v -T -N -L 2222:remote:22 username@intermediate
Terminal 2:
# do your scp command(s) like this example
scp -P 2222 localhost:/path/to/file .
Substitute appropriate hostnames or IP addresses for remote and intermediate.
In the scp
command /path/to/file
is the path on the remote server.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Going the direct route is probably not possible. But if you are able to log into the intermediate with ssh
and then from there log into the remote with ssh
then you can use something called local port forwarding to copy the files on your local machine with scp
. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate.
Try the following on two separate terminals (command lines, shells, etc.)
Terminal 1:
# set up 'local port forwarding'
ssh -v -T -N -L 2222:remote:22 username@intermediate
Terminal 2:
# do your scp command(s) like this example
scp -P 2222 localhost:/path/to/file .
Substitute appropriate hostnames or IP addresses for remote and intermediate.
In the scp
command /path/to/file
is the path on the remote server.
Going the direct route is probably not possible. But if you are able to log into the intermediate with ssh
and then from there log into the remote with ssh
then you can use something called local port forwarding to copy the files on your local machine with scp
. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate.
Try the following on two separate terminals (command lines, shells, etc.)
Terminal 1:
# set up 'local port forwarding'
ssh -v -T -N -L 2222:remote:22 username@intermediate
Terminal 2:
# do your scp command(s) like this example
scp -P 2222 localhost:/path/to/file .
Substitute appropriate hostnames or IP addresses for remote and intermediate.
In the scp
command /path/to/file
is the path on the remote server.
edited Oct 16 '17 at 10:30
answered Oct 16 '17 at 10:17
B Layer
3,9241525
3,9241525
add a comment |Â
add a comment |Â
up vote
1
down vote
You don't need port forwarding, you can do it with ProxyCommand
. Add something like this to ~/.ssh/config
:
Host some_name
Hostname internal.example.com
User internal_user
ProxyCommand ssh -A -q -l %r -W %h:%p external.example.com
This will allow you to ssh
to the internal machine with ssh some_name
, use scp
, etc.
add a comment |Â
up vote
1
down vote
You don't need port forwarding, you can do it with ProxyCommand
. Add something like this to ~/.ssh/config
:
Host some_name
Hostname internal.example.com
User internal_user
ProxyCommand ssh -A -q -l %r -W %h:%p external.example.com
This will allow you to ssh
to the internal machine with ssh some_name
, use scp
, etc.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You don't need port forwarding, you can do it with ProxyCommand
. Add something like this to ~/.ssh/config
:
Host some_name
Hostname internal.example.com
User internal_user
ProxyCommand ssh -A -q -l %r -W %h:%p external.example.com
This will allow you to ssh
to the internal machine with ssh some_name
, use scp
, etc.
You don't need port forwarding, you can do it with ProxyCommand
. Add something like this to ~/.ssh/config
:
Host some_name
Hostname internal.example.com
User internal_user
ProxyCommand ssh -A -q -l %r -W %h:%p external.example.com
This will allow you to ssh
to the internal machine with ssh some_name
, use scp
, etc.
answered Oct 16 '17 at 11:01
Satà  Katsura
10.7k11533
10.7k11533
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398370%2fhow-to-copy-files-from-a-double-remote-server-on-a-local-machine%23new-answer', 'question_page');
);
Post as a guest
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
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
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
How are you connecting to the intermediate? If you are using
ssh
you can use something called port forwarding to copy the files. It'll look like you are copying directly from the remote but you'll actually be tunneling through the intermediate. The direct path is probably not possible.â B Layer
Oct 16 '17 at 10:11
@BLayer Thanks a lot for the reply. Yes, I am using ssh to connect to the intermediate server.
â Eman
Oct 16 '17 at 10:17
It worked? I see you accepted. That was fast. :)
â B Layer
Oct 16 '17 at 10:21
@BLayer Yup, thanks:)
â Eman
Oct 16 '17 at 10:21
Awesome. You're welcome.
â B Layer
Oct 16 '17 at 10:21