Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As a university student, I am allowed to access my schools computers to work from home. However, it get there, i have to SSH to the university's general server, then SSH to the CIS departments server.

What I am trying to do is have access to the files on the CIS server that I can work on with a graphical text editor like gEdit.

In otherwords, I need to:

ssh general.server.com -l username 

then

ssh cis.server.com

and I want cis.server.com to be mounted.

Any help would be greatly appreciated.

share|improve this question

migrated from serverfault.com Jan 13 '12 at 22:26

This question came from our site for professional system and network administrators.

add comment

2 Answers

It's a little inefficient (systems are working harder), but you could forward a port via SSH to the internal box. Use the following to forward whatever port SSH is running on the internal server to any high port on your local machine.

ssh -C -f -g -N -x -L<localport>:<internalserver>:<port_you_run_ssh_on> username@gateway

You can then use sshfs to mount localhost at localport.

That'll give you a background SSH connection. I usually make an alias for the first part (up to the -x) so I don't have to type them in every time I need to set up a connection.

Alternatively, you can just use the above to set up an SSH tunnel and then ssh with X forwarding, or transfer the file via sftp to your local machine and edit.

If you just need to edit text files, consider learning how to use a console-based text editor (like Vim or Emacs)--they're nice, powerful, and have GUI versions that you can use later. Then just edit directly on the remote system. I prefer Vim myself.

share|improve this answer
add comment

In the ssh config of your client build a configuration.

Host aliasforsystem
    ProxyCommand /usr/bin/ssh username@general.server.com "/bin/netcat -w 1 cis.server.com 22"

Then just ssh to aliasforsystem. You should be able to mount that aliasdirectly. If you have ssh keys setup then it should be really simple. You do need the general system to have netcat or something similar installed though.

You could also build tunnels starting one connection with a portforward to the internal box. Leave that open, and then connect to the internal system via the port forward.

share|improve this answer
    
The general server does not appear to have netcat installed. Could you list some alternatives that would work? –  binaryOne Jan 13 '12 at 2:20
1  
@binaryOne - You are a CS student I presume? Go download the netcat source, build it, & install it under your home directory. :-) (really, it's not as hard as you think it will be) –  voretaq7 Jan 13 '12 at 22:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.