sshfs as root on a remote host by connecting first as normal user in debian 9
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Time ago I configured my remote machine following a common best practice where you shouldn't make the root access directly available via ssh.
When I have to administer my machine I connect to it via myuser account:
ssh myuser@remotehost
then I switch to the root account with
su root
And I can carry all my administrative commands with it.
Now I'm in the need to mount locally via sshfs some remote folders that are under root privileges.
With a direct sshfs user@remote_host:/mnt/remote_folder /mnt/local_folder
I can't do it because I can only log in via myuser, so I should tell sshfs to login, su root and then enstablish the link.
It should be doable, but I don't know the correct syntax, could someone help me ?
(I would like to know the syntax for also all the times that I want to connect via ssh and switch user at same time)
I found this question that seems similiar but Centos and Ubuntu are covered while debian 9 probably have some minor changes to do:
https://serverfault.com/questions/158392/how-do-i-sudo-over-sshfs
linux bash debian sudo fuse
add a comment |Â
up vote
0
down vote
favorite
Time ago I configured my remote machine following a common best practice where you shouldn't make the root access directly available via ssh.
When I have to administer my machine I connect to it via myuser account:
ssh myuser@remotehost
then I switch to the root account with
su root
And I can carry all my administrative commands with it.
Now I'm in the need to mount locally via sshfs some remote folders that are under root privileges.
With a direct sshfs user@remote_host:/mnt/remote_folder /mnt/local_folder
I can't do it because I can only log in via myuser, so I should tell sshfs to login, su root and then enstablish the link.
It should be doable, but I don't know the correct syntax, could someone help me ?
(I would like to know the syntax for also all the times that I want to connect via ssh and switch user at same time)
I found this question that seems similiar but Centos and Ubuntu are covered while debian 9 probably have some minor changes to do:
https://serverfault.com/questions/158392/how-do-i-sudo-over-sshfs
linux bash debian sudo fuse
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Time ago I configured my remote machine following a common best practice where you shouldn't make the root access directly available via ssh.
When I have to administer my machine I connect to it via myuser account:
ssh myuser@remotehost
then I switch to the root account with
su root
And I can carry all my administrative commands with it.
Now I'm in the need to mount locally via sshfs some remote folders that are under root privileges.
With a direct sshfs user@remote_host:/mnt/remote_folder /mnt/local_folder
I can't do it because I can only log in via myuser, so I should tell sshfs to login, su root and then enstablish the link.
It should be doable, but I don't know the correct syntax, could someone help me ?
(I would like to know the syntax for also all the times that I want to connect via ssh and switch user at same time)
I found this question that seems similiar but Centos and Ubuntu are covered while debian 9 probably have some minor changes to do:
https://serverfault.com/questions/158392/how-do-i-sudo-over-sshfs
linux bash debian sudo fuse
Time ago I configured my remote machine following a common best practice where you shouldn't make the root access directly available via ssh.
When I have to administer my machine I connect to it via myuser account:
ssh myuser@remotehost
then I switch to the root account with
su root
And I can carry all my administrative commands with it.
Now I'm in the need to mount locally via sshfs some remote folders that are under root privileges.
With a direct sshfs user@remote_host:/mnt/remote_folder /mnt/local_folder
I can't do it because I can only log in via myuser, so I should tell sshfs to login, su root and then enstablish the link.
It should be doable, but I don't know the correct syntax, could someone help me ?
(I would like to know the syntax for also all the times that I want to connect via ssh and switch user at same time)
I found this question that seems similiar but Centos and Ubuntu are covered while debian 9 probably have some minor changes to do:
https://serverfault.com/questions/158392/how-do-i-sudo-over-sshfs
linux bash debian sudo fuse
linux bash debian sudo fuse
edited 6 mins ago
asked 12 mins ago
user3450548
89411329
89411329
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f480016%2fsshfs-as-root-on-a-remote-host-by-connecting-first-as-normal-user-in-debian-9%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