You could create ~/.ssh/config
with an appropriate config entry for your host like so:
Protocol 2
Host yourhost
User youruser
Hostname your.host.address
GSSAPIAuthentication no
Port 1234
For more options, consult man ssh_config
Obviously running Nautilus as your local root account (with sudo, gksu, etc) isn't going to give you root access on the server.
The problem is that the SFTP server within OpenSSH (which is what Nautilus is connecting to) doesn't support commands like sudo
— it's not a shell environment. What you're asking for simple isn't possible through the standard mechanisms.
However you are not without options. I'm not sure how familiar with SSH you are but you can tunnel ports back across a connection so you could connect normally, run a simple FTP server as root and tunnel all that back to your computer over SSH. Sounds horrible but it's fairly simple.
On the server, run:
# newer Ubuntu installs:
sudo apt-get install python-pyftpdlib
# older Ubuntu installs
sudo apt-get install python-pip
sudo pip install pyftpdlib
Then from your computer, just run a short SSH command:
# If you installed with pip
ssh -tL localhost:2121:localhost:2121 -L localhost:21212:localhost:21212 user@server "sudo python -m pyftpdlib -i localhost -w -p 2121 -r 21212-21212 -d /"
# If you installed with apt-get (and pyftpdlib is pre-1.3, true in 13.10)
ssh -tL localhost:2121:localhost:2121 -L localhost:21212:localhost:21212 user@server "sudo python -m pyftpdlib.ftpserver -i localhost -w -p 2121 -r 21212-21212 -d /"
And then in Nautilus (on your computer), connect to ftp://localhost:2121
. The magic of SSH will forward that over to the FTP server running as root.
There are other protocols (I've spent a while looking for a better one) but FTP is the easiest to get up and running thanks in large part to pyftpdlib
. You could do similar things with webdav et al, I'm sure... It would just be a lot more hacking around.
Best Answer
Yes that is possible. I have the following setup which works, but there might be easier ones.
In the file
~/.ssh/config
, add the following lines:You have to replace yourusername, hostname.of.sever.a and hostname.of.server.b After that, you can (in Nautilus) go to Places->Connect to Server (its actually File->Connect to Server on my machine). And then enter
B
. That should be all to see the server B.