Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I find myself ssh-ing into another machine a lot at work. So much so, that I use it more than simply using the terminal on my own desktop.

I know that (normally) when I open a new tab, it will change the directory to be in the same folder that I am currently in. Is there any way to have it check to see if I'm ssh'd into another machine and, if so, ssh into that machine as well so that I don't have to key in the host, port, and flags for the new ssh with each open tab?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

gnome-terminal → edit → profile preferences → title and command → run a custom command instead of my shell

you might want to make a new profile for using the local shell.

you can choose the default profile in edit → profiles

if you have to specify passwords when connecting over ssh, set up private/public key authentication.

share|improve this answer
    
That was perfect. Thanks! Also, would you happen to know how to clear the screen of the output after running that command? I tried just using an ssh ... && clear at the end but that raises an error. –  ashays Jul 23 '12 at 20:59
    
&& is bourne shell, it is not a command. you could do sh -c "ssh .. && clear" –  Janus Troelsen Jul 23 '12 at 21:05
    
That appears to run, but not actually remove the output. –  ashays Jul 23 '12 at 21:09
    
why not just set "when command exits" to "exit the terminal"? –  Janus Troelsen Jul 23 '12 at 21:13
    
I was wanting to supress what I thought was a message from ssh whenever I connected, but it actually appears to be a banner from the machine I'm connecting to. I think it's a separate problem entirely now. Thanks! –  ashays Jul 23 '12 at 21:28
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.