New Terminal tab same ssh connection
How do I open a new terminal tab so that it opens the same remote ssh connection as my current tab?
MacBook Pro, Mac OS X (10.6.8)
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
How do I open a new terminal tab so that it opens the same remote ssh connection as my current tab?
MacBook Pro, Mac OS X (10.6.8)
ssh connections are a single process running in one shell, and when you create a new tab you are creating a new local shell that will not be running this process. Furthermore the remote server will not accept a duplicate connection from you without authentication. In essence, this is impossible to do. The closest thing you can do is make use of the bash history, and press the up arrow to scroll through your most recent commands until you get to the ssh command you used for your current connection, and then execute it.
If the connection is a standard one you regularly use, then you can bookmark it in your .bashrc file by creating a function that points to it. For instance, the following in your .bashrc file would make a specific ssh connection be run by entering "myserver" at the command line:
function myserver() {
ssh username|password@hostname
}
You can leave out the password option to have it prompt you for the password each time (it is also more secure to leave out the password).
...you can also make an ssh menu of sorts, using similar commands and the bash history: http://reviews.cnet.com/8301-13727_7-20078003-263/create-an-automatic-ssh-server -menu-in-the-os-x-terminal/?tag=mncol;title
The new tab and establish same connection is a standard feature in the ssh client I use for windows. The company that makes the software is now called Tectia. It's gui based, where you would setup accounts and store the login info in the app. You would enter the password once and then could open a new tab that would just be another remote connection. You could also then just click 'Open File Transfer Window' and you would have an sftp gui without entering anymore login information. So I'm looking for the same type of app on mac or how to get that functionality because I need many many terminals open to tail different logs, etc. I can see the bashrc functions being useful but see a problem when I'm trying to remember the function name for 50 different servers instead of seeing a list in a gui.
Ah...if the client manages the connection then that will work; however, in OS X's terminal does not support this. The most the OS X terminal will do is store the server in the connections window (press command-K to see this) but it does not automatically manage them. The only way to do this in the OS X Terminal is by creating a shortcut to establish the connection.
New Terminal tab same ssh connection