How to open port 22 in OS X 10.6.7

I am trying to open port 22 in osx, so I can connect to localhost using ssh. This is my current situation:

ssh localhost ssh: connect to host localhost port 22: Connection refused 

I generated a key and transferred it to the authorized_keys file as follows:

 sh-keygen -t dsa -P '' -f ~/.ssh/id_dsa cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys 

Port Scan Network Utility confirms that 22 (and surprisingly 23) are closed.

Context: I am working on creating Hadoop locally. In my configuration, I start services on localhost: #### s and should open messages to them through ssh.

How to open 22? or may I be up against another problem (maybe a wrong-generated key?)

+65
ssh ssh-keys macos
Jun 11 2018-11-11T00:
source share
3 answers

I think your port is probably open, but you have nothing to listen to it.

Apple Mac OS X has SSH installed by default, but the SSH daemon is not enabled. This means that you cannot log in remotely or delete copies until you turn them on.

To enable it, go to the "System Preferences" section. In the section "Internet and network" there is an icon "Sharing". Run it. In the list that appears, check the Remote Login option. OS X Yosemite and later no longer has an Internet and Network menu; It has been migrated to accounts. The "Sharing" menu now has its own icon in the "System Preferences" main menu. (thanks @AstroCB)

This immediately launches the SSH daemon, and you can remotely log in using your username. The Sharing window shows the name and IP address to use below. You can also find this using 'whoami and' Ifconfig from the Terminal application.

These instructions are copied from Enable SSH on Mac OS X , but I wanted to make sure that they didn’t disappear and were quickly accessible.

+151
Jun 11 2018-11-11T00:
source share

I am using OSX 10.11.6 and this article works for me.

enter image description here

+11
Feb 04 '17 at 7:40
source share

I could not solve the problem; Then I did the following and the problem was resolved: Contact here :

 sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist (Supply your password when it is requested) sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist ssh -v localhost sudo launchctl list | grep "sshd" 46427 - com.openssh.sshd 
0
May 15 '16 at 5:54
source share



All Articles