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.

I want to make an SSH connection to another server with forwarding, but without having to log on to the remote server, nor interfere with the screen I am working on. I also need to access the connection to terminate it when I finish with it.

eg. say I want to do a mysql backup on a remote server so I use the command ssh user@remote -L 1234:localhost:3306 but after issuing the password I want to run the mysql command in the session, but be able to access the SSH connection when I finish with mysql and terminate it.

Is there some way this can be done?

share|improve this question

migrated from stackoverflow.com Oct 25 '12 at 18:08

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 1 down vote accepted

GNU screen, it should be installed on all Linux boxes by default.

http://www.gnu.org/software/screen/

Here is a good starters guide.

http://www.kuro5hin.org/story/2004/3/9/16838/14935

share|improve this answer
    
answer is a bit short, perhaps you can add a brief summary of the guide –  FredrikD Oct 26 '12 at 6:32
    
I think I have to explain myself better. It is all being done from the same window/screen automatically. I shouldn't have to switch to another Window or screen. Both the SSH command and the Mysql command should run from the same command line without switching. –  vfclists Oct 26 '12 at 10:48
add comment

You could write a script with AutoHotKey to open the window, run the command(s) and then minimize the window for you to deal with later.

share|improve this answer
    
I am running Linux via SSH. It isn't Windows –  vfclists Oct 25 '12 at 18:48
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.