I have no idea how this happened. I was messing with SSH tunneling into my Raspberry Pi (with no problems) and since then, every time I open terminal on my Ubuntu machine, it tries to ssh into the RPi. When not connected to a network, I actually have to press Ctrl+C before I get my terminal back or else wait for it to fail.

In my attempts to fix this, I have gone so far as to completely remove openssh-client, openssh-server, and ssh from my machine. The only change is that upon launching, terminal now informs me that ssh isn't installed (I presume this is because it is trying to run an ssh command every time). To be clear, this is the FIRST thing that comes up when I launch terminal:

The program 'ssh' is currently not installed. You can install it by typing:
sudo apt-get install openssh-client  

What did I do and how do I stop terminal from trying to run ssh every time it opens?

EDIT/UPDATE: I have played around with restoring my .bashrc file from /etc/skel/ and discovered that when I have NO .bashrc file in /HOME/ my terminal initializes correctly (i.e. without running ssh). However, as soon as I restore even the default .bashrc from /etc/skel/, I get the ssh prompt popping up again every time.

EDIT/UPDATE: I am officially an idiot! Indeed, .bashrc was sourcing a file that caused the problem. In fact, it was only .bash_aliases. I, in my infinite ineptitude, added an alias to shell into my pi without prefixing alias so it was running the command every time .bashrc ran the line. sigh

  • Did you make changes to your .bashrc? Nov 16, 2014 at 4:10
  • Certainly not intentionally. I looked through it and can't see any sign of ssh being executed anywhere.
    – medley56
    Nov 16, 2014 at 5:06

2 Answers 2


Look under the following locations for references for 'ssh' executable (including programs mentioned in 'source'd files within the listed location. (Note: assuming you use bash as your default shell)

$HOME/.bashrc OR $HOME/.bash_profile OR $HOME/.profile OR /etc/profile

  • I am using bash (should have clarified, sorry). I checked in the specified locations and didn't see any references to ssh anywhere. I tried to look in all the sourced files as well. The real function of all those files is a little beyond my understanding. Am I correct in thinking that .bashrc, .bash_profile, .profile, and /etc/profile essentially are in charge of how terminal behaves once it is launched? Also, any ideas at all as to what may have caused this? I am so far convinced it is connected to the RPi work I was doing.
    – medley56
    Nov 16, 2014 at 4:41
  • Figured it out. Thank you! I just learned a ton about how bash starts up.
    – medley56
    Nov 16, 2014 at 15:46

Install another Command Line Interface like GUAKE or any other terminal of your choice from the sofware center.

Now check if the problem persists even in that. If yes, there might be some common bash setting that is altered, which I don't know of. But if there is no autologin in the new Command Line Interface, then you need to change the setting of your original gnonme-Terminal:

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

See if there is an ssh command written in that. If there is, remove that option. Hope it helps.

  • This actually already occurred to me. I tried to change the gnome terminal setting already. But just to be sure, I also installed GUAKE and I get the same attempt to immediately run ssh. Therefore... common bash setting I suppose.
    – medley56
    Nov 16, 2014 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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