How solve error with sftp: Couldn't read packet: Connection reset by peer?

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











up vote
0
down vote

favorite












I did install sftp on CentOS
and did add new group:



groupadd sftp


did create new user:



useradd -m sftp_user_1 -s /sbin/nologin -g sftp


did create password:



passwd sftp_user_1


did change owner:



chown root /home/sftp_user_1


did change rights:



chmod 750 /home/sftp_user_1


did change owner:



chown sftp_user_1:sftp /home/sftp_user_1


did check user and group:



id sftp_user_1

[root@centos-24 home]# id sftp_user_1
uid=1000(sftp_user_1) gid=1000(sftp) groups=1000(sftp)


did make changes in file /etc/ssh/sshd_config



Subsystem sftp /usr/libexec/openssh/sftp-server


did change to



Subsystem sftp internal-sftp


did add in end of file



Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
ForceCommand internal-sftp


did restart service



systemctl restart sshd


did try to connect to sftp server and returned error:



[root@centos-24 home]# sftp sftp_user_1@localhost
sftp_user_1@localhost's password:
packet_write_wait: Connection to ::1 port 22: Broken pipe
Couldn't read packet: Connection reset by peer


How solve this problem?







share|improve this question



















  • You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
    – JigglyNaga
    Jun 13 at 12:15










  • now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
    – Nikolay Baranenko
    Jun 13 at 12:22










  • use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
    – tonioc
    Jun 16 at 17:12














up vote
0
down vote

favorite












I did install sftp on CentOS
and did add new group:



groupadd sftp


did create new user:



useradd -m sftp_user_1 -s /sbin/nologin -g sftp


did create password:



passwd sftp_user_1


did change owner:



chown root /home/sftp_user_1


did change rights:



chmod 750 /home/sftp_user_1


did change owner:



chown sftp_user_1:sftp /home/sftp_user_1


did check user and group:



id sftp_user_1

[root@centos-24 home]# id sftp_user_1
uid=1000(sftp_user_1) gid=1000(sftp) groups=1000(sftp)


did make changes in file /etc/ssh/sshd_config



Subsystem sftp /usr/libexec/openssh/sftp-server


did change to



Subsystem sftp internal-sftp


did add in end of file



Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
ForceCommand internal-sftp


did restart service



systemctl restart sshd


did try to connect to sftp server and returned error:



[root@centos-24 home]# sftp sftp_user_1@localhost
sftp_user_1@localhost's password:
packet_write_wait: Connection to ::1 port 22: Broken pipe
Couldn't read packet: Connection reset by peer


How solve this problem?







share|improve this question



















  • You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
    – JigglyNaga
    Jun 13 at 12:15










  • now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
    – Nikolay Baranenko
    Jun 13 at 12:22










  • use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
    – tonioc
    Jun 16 at 17:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I did install sftp on CentOS
and did add new group:



groupadd sftp


did create new user:



useradd -m sftp_user_1 -s /sbin/nologin -g sftp


did create password:



passwd sftp_user_1


did change owner:



chown root /home/sftp_user_1


did change rights:



chmod 750 /home/sftp_user_1


did change owner:



chown sftp_user_1:sftp /home/sftp_user_1


did check user and group:



id sftp_user_1

[root@centos-24 home]# id sftp_user_1
uid=1000(sftp_user_1) gid=1000(sftp) groups=1000(sftp)


did make changes in file /etc/ssh/sshd_config



Subsystem sftp /usr/libexec/openssh/sftp-server


did change to



Subsystem sftp internal-sftp


did add in end of file



Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
ForceCommand internal-sftp


did restart service



systemctl restart sshd


did try to connect to sftp server and returned error:



[root@centos-24 home]# sftp sftp_user_1@localhost
sftp_user_1@localhost's password:
packet_write_wait: Connection to ::1 port 22: Broken pipe
Couldn't read packet: Connection reset by peer


How solve this problem?







share|improve this question











I did install sftp on CentOS
and did add new group:



groupadd sftp


did create new user:



useradd -m sftp_user_1 -s /sbin/nologin -g sftp


did create password:



passwd sftp_user_1


did change owner:



chown root /home/sftp_user_1


did change rights:



chmod 750 /home/sftp_user_1


did change owner:



chown sftp_user_1:sftp /home/sftp_user_1


did check user and group:



id sftp_user_1

[root@centos-24 home]# id sftp_user_1
uid=1000(sftp_user_1) gid=1000(sftp) groups=1000(sftp)


did make changes in file /etc/ssh/sshd_config



Subsystem sftp /usr/libexec/openssh/sftp-server


did change to



Subsystem sftp internal-sftp


did add in end of file



Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
ForceCommand internal-sftp


did restart service



systemctl restart sshd


did try to connect to sftp server and returned error:



[root@centos-24 home]# sftp sftp_user_1@localhost
sftp_user_1@localhost's password:
packet_write_wait: Connection to ::1 port 22: Broken pipe
Couldn't read packet: Connection reset by peer


How solve this problem?









share|improve this question










share|improve this question




share|improve this question









asked Jun 13 at 11:35









Nikolay Baranenko

1097




1097











  • You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
    – JigglyNaga
    Jun 13 at 12:15










  • now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
    – Nikolay Baranenko
    Jun 13 at 12:22










  • use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
    – tonioc
    Jun 16 at 17:12
















  • You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
    – JigglyNaga
    Jun 13 at 12:15










  • now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
    – Nikolay Baranenko
    Jun 13 at 12:22










  • use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
    – tonioc
    Jun 16 at 17:12















You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
– JigglyNaga
Jun 13 at 12:15




You've changed the owner of /home/sftp_user_1 to sftp_user_1 only two steps after you changed it to root. Why did you set it to root in the first place? If you're following a set of instructions you found somewhere, please include that in your question.
– JigglyNaga
Jun 13 at 12:15












now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
– Nikolay Baranenko
Jun 13 at 12:22




now did returned error: sftp_user_1@localhost's password: Permission denied, please try again.
– Nikolay Baranenko
Jun 13 at 12:22












use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
– tonioc
Jun 16 at 17:12




use: 'tail -f /var/log/secure /var/log/audit ' and run your sftp call to check if useful messages come there. (and maybe increas loglevel to verbose in sshd_config...)
– tonioc
Jun 16 at 17:12










1 Answer
1






active

oldest

votes

















up vote
0
down vote













In this step



chown root /home/sftp_user_1


I must change and group to sftp



chown root:sftp /home/sftp_user_1


because in file /etc/ssh/sshd_config exist



Match Group sftp





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%2f449518%2fhow-solve-error-with-sftp-couldnt-read-packet-connection-reset-by-peer%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    In this step



    chown root /home/sftp_user_1


    I must change and group to sftp



    chown root:sftp /home/sftp_user_1


    because in file /etc/ssh/sshd_config exist



    Match Group sftp





    share|improve this answer

























      up vote
      0
      down vote













      In this step



      chown root /home/sftp_user_1


      I must change and group to sftp



      chown root:sftp /home/sftp_user_1


      because in file /etc/ssh/sshd_config exist



      Match Group sftp





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        In this step



        chown root /home/sftp_user_1


        I must change and group to sftp



        chown root:sftp /home/sftp_user_1


        because in file /etc/ssh/sshd_config exist



        Match Group sftp





        share|improve this answer













        In this step



        chown root /home/sftp_user_1


        I must change and group to sftp



        chown root:sftp /home/sftp_user_1


        because in file /etc/ssh/sshd_config exist



        Match Group sftp






        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jun 16 at 15:34









        Nikolay Baranenko

        1097




        1097






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f449518%2fhow-solve-error-with-sftp-couldnt-read-packet-connection-reset-by-peer%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay