Benches macOS

6

-bash: ssh: command not found = no ssh?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi all,

Sorry if this isn't the right category - this seemed to be the best fit.

I'm having trouble with SSH.

I've used ssh in the past (back when I was running Leopard) but I've never had all that much use for it. Today, however, I opened up terminal to SSH to an iMac on my local network, and got the following back:

-bash: ssh: command not found

Having a look around on the internet, somebody else said that they got this message but was still able to see the SSH manual by typing ssh man. However, when I tried this I just got "command not found" again.

Any ideas?

Thanks in advance,

BrutalSpoon.

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    Noah Robbin

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Can you see if running the command as '/usr/bin/ssh' works? If it does, can you give us the output of 'echo $PATH'

    Message was edited by: Noah Robbin

  2. 0

    LachlanRoy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I'm not entirely sure what you mean. I attempted "cd /usr/bin/ssh" but it returns:

    "-bash: cd: /usr/bin/ssh: Not a directory"

    Have I done something silly?

  3. 0

    etresoft

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Just type in "/usr/bin/ssh" and press enter.

    Then type in "echo $PATH" and press enter.

  4. 0

    LachlanRoy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Ah, that found it. echo $PATH gives:

    PATH:/usr/local/mysql/bin

    I don't think it's supposed to be like that, though... any easy way to fix it? With the mention of mysql would it have anything to do with me installing MAMP?

  5. 0

    baltwo

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You apparently have a hosed up installation. echo $PATH should at least return:

    /usr/bin:/bin:/usr/sbin:/sbin

    Minimum suggestioni would be to reinstall Snow Leopard and then update it.

    Post to the Unix forum under OS X Technologies for Unix and Terminal queries.

  6. 0

    BobHarris

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Do you remember if you modified .profile or .bash_profile when you installed mysql?

    I guess you could search for the file that has the modification


    /usr/bin/grep /usr/local/mysql/bin $HOME/.[a-z]*

    Once you find the file, edit that file and put a dollar sign infront of PATH


    /usr/bin/nano /name/of/file/with/mysql/bin/in/it

    The entry you want to fix most likely looks like


    export PATH=PATH:/usr/local/mysql/bin

    you want to change this to


    export PATH=$PATH:/usr/local/mysql/bin

    The problem is the missing dollar sign $ which would cause the current PATH to be substituted before the addition of /usr/local/mysql/bin.

    Once the change is made, quit Terminal and relaunch it. The corrected PATH should now work.

    NOTE: If you do not want to use
    nano you could use TextWrangler (via File -> Open Hidden...), or Smultron (via File -> Open Hidden...). You should be able to find these GUI based text editors via <http://versiontracker.com&gt;.

    Good luck.