I'm not able to ssh to localhost on my Mac. I found that sshd is not running in the machine (no process is running on port 22).
lsof -i:22
I found some posts asking to enable Remote Login
in System Preferences -> Sharing
. Eventhough it is enabled, I'm not able to ssh to localhost. The error I'm getting is this
$ssh -v localhost
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to localhost port 22.
debug1: Connection established.
debug1: identity file /Users/gkumar6/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gkumar6/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
ssh_exchange_identification: read: Connection reset by peer
Is there anything I'm missing here?
~/.ssh/config
look like? You can either create a key (ssh-keygen
) and put it in your~/.ssh/authorized_keys
or you can tweak your config to allow password login.~/.ssh/config
file in my system. How can I use it allow password login?sshd
running on the Mac (server) side. On Mac OS-Xsshd
is not runningstandalone
(i.e. as a long-lived independent service). Instead it is started on-demand bylaunchd
when the 'Sharing' -> 'Remote Login' service is enabled, and an incoming connection is made from a client to thesshd
port.