start sshd on mac

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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?










share|improve this question























  • It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
    – Bailey Parker
    Aug 10 at 19:50










  • There is no ~/.ssh/config file in my system. How can I use it allow password login?
    – pkgajulapalli
    Aug 11 at 1:03











  • If you have solved the problem, please post the solution as an answer instead of editing the question.
    – muru
    Aug 13 at 2:59










  • Added the solution as answer.
    – pkgajulapalli
    Aug 13 at 3:03














up vote
1
down vote

favorite












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?










share|improve this question























  • It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
    – Bailey Parker
    Aug 10 at 19:50










  • There is no ~/.ssh/config file in my system. How can I use it allow password login?
    – pkgajulapalli
    Aug 11 at 1:03











  • If you have solved the problem, please post the solution as an answer instead of editing the question.
    – muru
    Aug 13 at 2:59










  • Added the solution as answer.
    – pkgajulapalli
    Aug 13 at 3:03












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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?










share|improve this question















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 osx sshd macintosh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 13 at 4:45









muru

33.6k577144




33.6k577144










asked Aug 10 at 16:45









pkgajulapalli

1064




1064











  • It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
    – Bailey Parker
    Aug 10 at 19:50










  • There is no ~/.ssh/config file in my system. How can I use it allow password login?
    – pkgajulapalli
    Aug 11 at 1:03











  • If you have solved the problem, please post the solution as an answer instead of editing the question.
    – muru
    Aug 13 at 2:59










  • Added the solution as answer.
    – pkgajulapalli
    Aug 13 at 3:03
















  • It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
    – Bailey Parker
    Aug 10 at 19:50










  • There is no ~/.ssh/config file in my system. How can I use it allow password login?
    – pkgajulapalli
    Aug 11 at 1:03











  • If you have solved the problem, please post the solution as an answer instead of editing the question.
    – muru
    Aug 13 at 2:59










  • Added the solution as answer.
    – pkgajulapalli
    Aug 13 at 3:03















It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
– Bailey Parker
Aug 10 at 19:50




It seems like your client is trying to load a bunch of keys and then failing. What does your ~/.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.
– Bailey Parker
Aug 10 at 19:50












There is no ~/.ssh/config file in my system. How can I use it allow password login?
– pkgajulapalli
Aug 11 at 1:03





There is no ~/.ssh/config file in my system. How can I use it allow password login?
– pkgajulapalli
Aug 11 at 1:03













If you have solved the problem, please post the solution as an answer instead of editing the question.
– muru
Aug 13 at 2:59




If you have solved the problem, please post the solution as an answer instead of editing the question.
– muru
Aug 13 at 2:59












Added the solution as answer.
– pkgajulapalli
Aug 13 at 3:03




Added the solution as answer.
– pkgajulapalli
Aug 13 at 3:03










3 Answers
3






active

oldest

votes

















up vote
2
down vote













The log you are posting is showing that the secure shell daemon is running:



debug1: Connection established.


You would not see that line were it not; would instead see a more succinct log ending with Connection refused.



You are not seeing any output from lsof most likely because you are not running the command with sufficient privileges:



$ lsof -i:22
$ echo $?
1
$ sudo lsof -i:22
sudo lsof -i:22
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
launchd 1 root 12u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
launchd 1 root 16u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)
launchd 1 root 22u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
launchd 1 root 23u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)


The echo statement preceding the second attempt is showing that the previous command returned an exit code of 1, indicating an error state.






share|improve this answer




















  • You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
    – pkgajulapalli
    Aug 10 at 19:14

















up vote
1
down vote













Have you loaded sshd?



launchctl load -w /System/Library/LaunchDaemons/ssh.plist





share|improve this answer




















  • Yes, but still not able to ssh to localhost
    – pkgajulapalli
    Aug 11 at 1:04

















up vote
0
down vote













I've found the solution for this



I tried to run the sshd process manually listening to a different port to debug the issue.



sudo /usr/sbin/sshd -d -p 2222


It showed the actual problem.



debug1: sshd version OpenSSH_7.6, LibreSSL 2.6.2
debug1: private host key #0: ssh-rsa SHA256:oECJtUeeA3sNrAQj3phBiuWJoVl00dzLiXi20tlWF/o
debug1: private host key #1: ssh-dss SHA256:uVnKrOK+4V+y3QalyFdqDz+9eBN4oi2E3wb1MDBcgzc
debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:CWapRrGUSJx2doJkDf2YR/aZy4BJ4j9K1/ZwX4eUZcg
debug1: private host key #3: ssh-ed25519 SHA256:sjzAks0Hud+Ah941pd8ZRNO6MWENdhO8wW4NMNDL2Ns
/var/empty must be owned by root and not group or world-writable.


The permissions to the directory /var/empty were



drwxr-xr-x 7 gkumar6 sys 224B Aug 12 21:02 empty


So I've changed it to sudo chown root:wheel /var/empty



drwxr-xr-x 7 root wheel 224B Aug 12 21:02 empty


This has solved the problem for me.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461851%2fstart-sshd-on-mac%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    The log you are posting is showing that the secure shell daemon is running:



    debug1: Connection established.


    You would not see that line were it not; would instead see a more succinct log ending with Connection refused.



    You are not seeing any output from lsof most likely because you are not running the command with sufficient privileges:



    $ lsof -i:22
    $ echo $?
    1
    $ sudo lsof -i:22
    sudo lsof -i:22
    Password:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    launchd 1 root 12u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 16u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 22u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 23u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)


    The echo statement preceding the second attempt is showing that the previous command returned an exit code of 1, indicating an error state.






    share|improve this answer




















    • You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
      – pkgajulapalli
      Aug 10 at 19:14














    up vote
    2
    down vote













    The log you are posting is showing that the secure shell daemon is running:



    debug1: Connection established.


    You would not see that line were it not; would instead see a more succinct log ending with Connection refused.



    You are not seeing any output from lsof most likely because you are not running the command with sufficient privileges:



    $ lsof -i:22
    $ echo $?
    1
    $ sudo lsof -i:22
    sudo lsof -i:22
    Password:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    launchd 1 root 12u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 16u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 22u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 23u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)


    The echo statement preceding the second attempt is showing that the previous command returned an exit code of 1, indicating an error state.






    share|improve this answer




















    • You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
      – pkgajulapalli
      Aug 10 at 19:14












    up vote
    2
    down vote










    up vote
    2
    down vote









    The log you are posting is showing that the secure shell daemon is running:



    debug1: Connection established.


    You would not see that line were it not; would instead see a more succinct log ending with Connection refused.



    You are not seeing any output from lsof most likely because you are not running the command with sufficient privileges:



    $ lsof -i:22
    $ echo $?
    1
    $ sudo lsof -i:22
    sudo lsof -i:22
    Password:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    launchd 1 root 12u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 16u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 22u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 23u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)


    The echo statement preceding the second attempt is showing that the previous command returned an exit code of 1, indicating an error state.






    share|improve this answer












    The log you are posting is showing that the secure shell daemon is running:



    debug1: Connection established.


    You would not see that line were it not; would instead see a more succinct log ending with Connection refused.



    You are not seeing any output from lsof most likely because you are not running the command with sufficient privileges:



    $ lsof -i:22
    $ echo $?
    1
    $ sudo lsof -i:22
    sudo lsof -i:22
    Password:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    launchd 1 root 12u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 16u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 22u IPv6 0x2feb0cecf91e551b 0t0 TCP *:ssh (LISTEN)
    launchd 1 root 23u IPv4 0x2feb0cecf91ec3a3 0t0 TCP *:ssh (LISTEN)


    The echo statement preceding the second attempt is showing that the previous command returned an exit code of 1, indicating an error state.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 10 at 16:58









    DopeGhoti

    41k55080




    41k55080











    • You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
      – pkgajulapalli
      Aug 10 at 19:14
















    • You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
      – pkgajulapalli
      Aug 10 at 19:14















    You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
    – pkgajulapalli
    Aug 10 at 19:14




    You are correct. The sshd process is running. But do you know why I'm not able to connect to localhost via ssh?
    – pkgajulapalli
    Aug 10 at 19:14












    up vote
    1
    down vote













    Have you loaded sshd?



    launchctl load -w /System/Library/LaunchDaemons/ssh.plist





    share|improve this answer




















    • Yes, but still not able to ssh to localhost
      – pkgajulapalli
      Aug 11 at 1:04














    up vote
    1
    down vote













    Have you loaded sshd?



    launchctl load -w /System/Library/LaunchDaemons/ssh.plist





    share|improve this answer




















    • Yes, but still not able to ssh to localhost
      – pkgajulapalli
      Aug 11 at 1:04












    up vote
    1
    down vote










    up vote
    1
    down vote









    Have you loaded sshd?



    launchctl load -w /System/Library/LaunchDaemons/ssh.plist





    share|improve this answer












    Have you loaded sshd?



    launchctl load -w /System/Library/LaunchDaemons/ssh.plist






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 10 at 20:49









    d g

    1111




    1111











    • Yes, but still not able to ssh to localhost
      – pkgajulapalli
      Aug 11 at 1:04
















    • Yes, but still not able to ssh to localhost
      – pkgajulapalli
      Aug 11 at 1:04















    Yes, but still not able to ssh to localhost
    – pkgajulapalli
    Aug 11 at 1:04




    Yes, but still not able to ssh to localhost
    – pkgajulapalli
    Aug 11 at 1:04










    up vote
    0
    down vote













    I've found the solution for this



    I tried to run the sshd process manually listening to a different port to debug the issue.



    sudo /usr/sbin/sshd -d -p 2222


    It showed the actual problem.



    debug1: sshd version OpenSSH_7.6, LibreSSL 2.6.2
    debug1: private host key #0: ssh-rsa SHA256:oECJtUeeA3sNrAQj3phBiuWJoVl00dzLiXi20tlWF/o
    debug1: private host key #1: ssh-dss SHA256:uVnKrOK+4V+y3QalyFdqDz+9eBN4oi2E3wb1MDBcgzc
    debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:CWapRrGUSJx2doJkDf2YR/aZy4BJ4j9K1/ZwX4eUZcg
    debug1: private host key #3: ssh-ed25519 SHA256:sjzAks0Hud+Ah941pd8ZRNO6MWENdhO8wW4NMNDL2Ns
    /var/empty must be owned by root and not group or world-writable.


    The permissions to the directory /var/empty were



    drwxr-xr-x 7 gkumar6 sys 224B Aug 12 21:02 empty


    So I've changed it to sudo chown root:wheel /var/empty



    drwxr-xr-x 7 root wheel 224B Aug 12 21:02 empty


    This has solved the problem for me.






    share|improve this answer
























      up vote
      0
      down vote













      I've found the solution for this



      I tried to run the sshd process manually listening to a different port to debug the issue.



      sudo /usr/sbin/sshd -d -p 2222


      It showed the actual problem.



      debug1: sshd version OpenSSH_7.6, LibreSSL 2.6.2
      debug1: private host key #0: ssh-rsa SHA256:oECJtUeeA3sNrAQj3phBiuWJoVl00dzLiXi20tlWF/o
      debug1: private host key #1: ssh-dss SHA256:uVnKrOK+4V+y3QalyFdqDz+9eBN4oi2E3wb1MDBcgzc
      debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:CWapRrGUSJx2doJkDf2YR/aZy4BJ4j9K1/ZwX4eUZcg
      debug1: private host key #3: ssh-ed25519 SHA256:sjzAks0Hud+Ah941pd8ZRNO6MWENdhO8wW4NMNDL2Ns
      /var/empty must be owned by root and not group or world-writable.


      The permissions to the directory /var/empty were



      drwxr-xr-x 7 gkumar6 sys 224B Aug 12 21:02 empty


      So I've changed it to sudo chown root:wheel /var/empty



      drwxr-xr-x 7 root wheel 224B Aug 12 21:02 empty


      This has solved the problem for me.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I've found the solution for this



        I tried to run the sshd process manually listening to a different port to debug the issue.



        sudo /usr/sbin/sshd -d -p 2222


        It showed the actual problem.



        debug1: sshd version OpenSSH_7.6, LibreSSL 2.6.2
        debug1: private host key #0: ssh-rsa SHA256:oECJtUeeA3sNrAQj3phBiuWJoVl00dzLiXi20tlWF/o
        debug1: private host key #1: ssh-dss SHA256:uVnKrOK+4V+y3QalyFdqDz+9eBN4oi2E3wb1MDBcgzc
        debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:CWapRrGUSJx2doJkDf2YR/aZy4BJ4j9K1/ZwX4eUZcg
        debug1: private host key #3: ssh-ed25519 SHA256:sjzAks0Hud+Ah941pd8ZRNO6MWENdhO8wW4NMNDL2Ns
        /var/empty must be owned by root and not group or world-writable.


        The permissions to the directory /var/empty were



        drwxr-xr-x 7 gkumar6 sys 224B Aug 12 21:02 empty


        So I've changed it to sudo chown root:wheel /var/empty



        drwxr-xr-x 7 root wheel 224B Aug 12 21:02 empty


        This has solved the problem for me.






        share|improve this answer












        I've found the solution for this



        I tried to run the sshd process manually listening to a different port to debug the issue.



        sudo /usr/sbin/sshd -d -p 2222


        It showed the actual problem.



        debug1: sshd version OpenSSH_7.6, LibreSSL 2.6.2
        debug1: private host key #0: ssh-rsa SHA256:oECJtUeeA3sNrAQj3phBiuWJoVl00dzLiXi20tlWF/o
        debug1: private host key #1: ssh-dss SHA256:uVnKrOK+4V+y3QalyFdqDz+9eBN4oi2E3wb1MDBcgzc
        debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:CWapRrGUSJx2doJkDf2YR/aZy4BJ4j9K1/ZwX4eUZcg
        debug1: private host key #3: ssh-ed25519 SHA256:sjzAks0Hud+Ah941pd8ZRNO6MWENdhO8wW4NMNDL2Ns
        /var/empty must be owned by root and not group or world-writable.


        The permissions to the directory /var/empty were



        drwxr-xr-x 7 gkumar6 sys 224B Aug 12 21:02 empty


        So I've changed it to sudo chown root:wheel /var/empty



        drwxr-xr-x 7 root wheel 224B Aug 12 21:02 empty


        This has solved the problem for me.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 13 at 3:03









        pkgajulapalli

        1064




        1064



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461851%2fstart-sshd-on-mac%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)