sshfs through two hops?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to mount a folder in a remote location to /mnt/volume on my mac but this folder is usually accessed through a login server myname@server-login.com using SSH like ssh -A -Y -o myname@server-login.com
(the -A is necessary as it uses the same SSH key for subsequent hops) and then once on this server I do ssh -A -Y -o myname@server-main.com
. I want to mount a folder in this server-main to my mac. How do I do this?
I have verified I can mount a folder on the server-login like so: sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa myname@server-login.com:/home/users/myname /mnt/volume
So my sshfs is working.
I tried this method https://www.larkinweb.co.uk/computing/mounting_file_systems_over_two_ssh_hops.html
Where I did ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
and then sudo sshfs -p 2223 myname@server-main.com:/ /mnt/volume
But it comes back with remote host has disconnected
.
linux ssh mount ssh-tunneling sshfs
add a comment |
up vote
0
down vote
favorite
I want to mount a folder in a remote location to /mnt/volume on my mac but this folder is usually accessed through a login server myname@server-login.com using SSH like ssh -A -Y -o myname@server-login.com
(the -A is necessary as it uses the same SSH key for subsequent hops) and then once on this server I do ssh -A -Y -o myname@server-main.com
. I want to mount a folder in this server-main to my mac. How do I do this?
I have verified I can mount a folder on the server-login like so: sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa myname@server-login.com:/home/users/myname /mnt/volume
So my sshfs is working.
I tried this method https://www.larkinweb.co.uk/computing/mounting_file_systems_over_two_ssh_hops.html
Where I did ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
and then sudo sshfs -p 2223 myname@server-main.com:/ /mnt/volume
But it comes back with remote host has disconnected
.
linux ssh mount ssh-tunneling sshfs
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to mount a folder in a remote location to /mnt/volume on my mac but this folder is usually accessed through a login server myname@server-login.com using SSH like ssh -A -Y -o myname@server-login.com
(the -A is necessary as it uses the same SSH key for subsequent hops) and then once on this server I do ssh -A -Y -o myname@server-main.com
. I want to mount a folder in this server-main to my mac. How do I do this?
I have verified I can mount a folder on the server-login like so: sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa myname@server-login.com:/home/users/myname /mnt/volume
So my sshfs is working.
I tried this method https://www.larkinweb.co.uk/computing/mounting_file_systems_over_two_ssh_hops.html
Where I did ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
and then sudo sshfs -p 2223 myname@server-main.com:/ /mnt/volume
But it comes back with remote host has disconnected
.
linux ssh mount ssh-tunneling sshfs
I want to mount a folder in a remote location to /mnt/volume on my mac but this folder is usually accessed through a login server myname@server-login.com using SSH like ssh -A -Y -o myname@server-login.com
(the -A is necessary as it uses the same SSH key for subsequent hops) and then once on this server I do ssh -A -Y -o myname@server-main.com
. I want to mount a folder in this server-main to my mac. How do I do this?
I have verified I can mount a folder on the server-login like so: sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa myname@server-login.com:/home/users/myname /mnt/volume
So my sshfs is working.
I tried this method https://www.larkinweb.co.uk/computing/mounting_file_systems_over_two_ssh_hops.html
Where I did ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
and then sudo sshfs -p 2223 myname@server-main.com:/ /mnt/volume
But it comes back with remote host has disconnected
.
linux ssh mount ssh-tunneling sshfs
linux ssh mount ssh-tunneling sshfs
edited 2 days ago
Rui F Ribeiro
38.2k1475123
38.2k1475123
asked 2 days ago
ru111
343
343
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
In the article you are quoting there are two commands. The first,
$ ssh -f userB@systemB -L 2222:systemC:22 -N
establishes a tunnel between the local host and systemB
; requests made to localhost:2222
are forwarded to port 22
on systemC
.
Hence, to mount the /remote/path/
(that sits on systemC
) on localhost
you have to connect to localhost:2222
, as in the second command:
$ sshfs -p 2222 userC@localhost:/remote/path/ /mnt/localpath/
But in your question you are trying to connect to systemC:2223
.
It should be, instead:
$ ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
$ sudo sshfs -p 2223 myname@localhost:/ /mnt/volume
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I didsudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...
– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to runsshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on/mnt/volume/
you will have the remote, mounted, directory, and the local content of/mnt/volume
will not be accessible. Choose a different mount point if this is a problem.
– fra-san
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
In the article you are quoting there are two commands. The first,
$ ssh -f userB@systemB -L 2222:systemC:22 -N
establishes a tunnel between the local host and systemB
; requests made to localhost:2222
are forwarded to port 22
on systemC
.
Hence, to mount the /remote/path/
(that sits on systemC
) on localhost
you have to connect to localhost:2222
, as in the second command:
$ sshfs -p 2222 userC@localhost:/remote/path/ /mnt/localpath/
But in your question you are trying to connect to systemC:2223
.
It should be, instead:
$ ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
$ sudo sshfs -p 2223 myname@localhost:/ /mnt/volume
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I didsudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...
– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to runsshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on/mnt/volume/
you will have the remote, mounted, directory, and the local content of/mnt/volume
will not be accessible. Choose a different mount point if this is a problem.
– fra-san
2 days ago
add a comment |
up vote
0
down vote
In the article you are quoting there are two commands. The first,
$ ssh -f userB@systemB -L 2222:systemC:22 -N
establishes a tunnel between the local host and systemB
; requests made to localhost:2222
are forwarded to port 22
on systemC
.
Hence, to mount the /remote/path/
(that sits on systemC
) on localhost
you have to connect to localhost:2222
, as in the second command:
$ sshfs -p 2222 userC@localhost:/remote/path/ /mnt/localpath/
But in your question you are trying to connect to systemC:2223
.
It should be, instead:
$ ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
$ sudo sshfs -p 2223 myname@localhost:/ /mnt/volume
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I didsudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...
– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to runsshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on/mnt/volume/
you will have the remote, mounted, directory, and the local content of/mnt/volume
will not be accessible. Choose a different mount point if this is a problem.
– fra-san
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
In the article you are quoting there are two commands. The first,
$ ssh -f userB@systemB -L 2222:systemC:22 -N
establishes a tunnel between the local host and systemB
; requests made to localhost:2222
are forwarded to port 22
on systemC
.
Hence, to mount the /remote/path/
(that sits on systemC
) on localhost
you have to connect to localhost:2222
, as in the second command:
$ sshfs -p 2222 userC@localhost:/remote/path/ /mnt/localpath/
But in your question you are trying to connect to systemC:2223
.
It should be, instead:
$ ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
$ sudo sshfs -p 2223 myname@localhost:/ /mnt/volume
In the article you are quoting there are two commands. The first,
$ ssh -f userB@systemB -L 2222:systemC:22 -N
establishes a tunnel between the local host and systemB
; requests made to localhost:2222
are forwarded to port 22
on systemC
.
Hence, to mount the /remote/path/
(that sits on systemC
) on localhost
you have to connect to localhost:2222
, as in the second command:
$ sshfs -p 2222 userC@localhost:/remote/path/ /mnt/localpath/
But in your question you are trying to connect to systemC:2223
.
It should be, instead:
$ ssh -f myname@server-login.com -L 2223:server-main.com:22 -N
$ sudo sshfs -p 2223 myname@localhost:/ /mnt/volume
answered 2 days ago
fra-san
586210
586210
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I didsudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...
– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to runsshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on/mnt/volume/
you will have the remote, mounted, directory, and the local content of/mnt/volume
will not be accessible. Choose a different mount point if this is a problem.
– fra-san
2 days ago
add a comment |
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I didsudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...
– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to runsshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on/mnt/volume/
you will have the remote, mounted, directory, and the local content of/mnt/volume
will not be accessible. Choose a different mount point if this is a problem.
– fra-san
2 days ago
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I did
sudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...– ru111
2 days ago
Thanks - I think I can use 2222 actually. So because I want mount a specific folder accessed through server-main, I did
sudo sshfs -p 2222 myname@localhost:/group/data /mnt/volume
. It did something, but now I can't access the folder on my mac - /mnt/volume disappears and accessing through the command line it gives me "no such file or directory". Unmounting brings me back the folder...– ru111
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to run
sshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on /mnt/volume/
you will have the remote, mounted, directory, and the local content of /mnt/volume
will not be accessible. Choose a different mount point if this is a problem.– fra-san
2 days ago
1) Port: you can choose the one you like most, as long as it's not already in use. 2) You probably don't want to run
sshfs
as root; you can run it as your user, just make sure to pick as mount point a directory you can write to (other users won't be able to access it). 3) That is how mounting works: on /mnt/volume/
you will have the remote, mounted, directory, and the local content of /mnt/volume
will not be accessible. Choose a different mount point if this is a problem.– fra-san
2 days ago
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482147%2fsshfs-through-two-hops%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