Sunday, May 19, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 369  / 1 Year ago, mon, april 24, 2023, 12:16:04

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
username@username-ThinkPad-X230:~$


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


More From » command-line

 Answers
7

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


[#22375] Wednesday, April 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
moloy

Total Points: 457
Total Questions: 93
Total Answers: 119

Location: Romania
Member since Wed, Dec 29, 2021
2 Years ago
;