SSH logon failure due to permission error

Source: Internet
Author: User

Tag: Permission error causes

SSH logon failure due to permission error

Reference:http://blog.csdn.net/ucan23/article/details/49850365


Yesterday due to the deployment of the developer's service to the/OPT/BH directory, and Ln-s/opt/bh/var, and then modify the permissions, it should be performed:

Chown-r Amos:amos/opt/amos

But the error has been performed:

Chown-r Amos:amos/var/amos


Then SSH login error:


[[email protected] shell]# ssh [email protected]

Ssh_exchange_identification:connection Closed by remote host


The reason for this is the permission error:

Chown-r root:root/var/empty/sshd chmod 744/var/empty/sshd service sshd restart


But now you can not login, how to do?


Fortunately, we deployed the Som-zagend service and executed the following two commands on other servers in the intranet, and then logged in.

[[email protected] ~]# curl --data  ' chown -r root:root /var/empty/sshd '   ' Http://10.0.0.11:54321/api/runCommand?user=root ' {"Session": "588063BB-1CAB-F613-0812-0017FA0088BC"}[[ email protected] ~]# ssh 10.0.0.11ssh: connect to host 10.0.0.11  port 22: connection refused[[email protected] ~]# curl --data  ' chmod  744 /var/empty/sshd '   ' Http://10.0.0.11:54321/api/runCommand?user=root ' {"Session": " 588063F3-30A5-F639-0812-0017FA0088BC "}[[email protected] ~]# [[email protected] ~]#  curl --data  '/etc/init.d/sshd restart '   ' http://10.0.0.11:54321/api/runCommand?user= Root ' {' Session ': ' 588063F8-B7CD-F63A-0812-0017FA0088BC '}[[email protected] ~]# [[email  protected] ~]# [[email protected] ~]# curl --get --include  '/HTTP 10.0.0.11:54321/api/getrunconsole?seSSION=588063F8-B7CD-F63A-0812-0017FA0088BC ' http/1.1 200 okserver: som  (zagent) Content-Type :  text/plainzagent-done: 1000zagent-seqid: 98711zagent-stamp: 1484809209669content-length:  50STOPPING SSHD: [FAILED]STARTING SSHD: [  OK  ] login successful [[email  protected] ~]# ssh 10.0.0.11The authenticity of host  ' 10.0.0.11  (10.0.0.11) '  can ' t be established. Rsa key fingerprint is 93:a6:80:ca:27:09:ae:34:6e:55:f6:fb:e2:7c:00:a7. are you sure you want to continue connecting  (yes/no)?  yesWarning : permanently added  ' 10.0.0.11 '   (RSA)  to the list of known  Hosts. [email protected] ' s password: last login: wed jan 18 16:13:40  2017 from dmp-vm-web-01[[email protected] ~] #注: How to copy a file [[Email protected] ~]# curl --data  ' scp /etc/ssh/sshd_config 10.0.0.11:/tmp '   ' HTTP// 10.0.0.11:54321/api/runcommand?user=root ' {"Session": "588064C6-9D22-F6C4-0812-0017FA0088BC"}[[email  Protected] ~]# ssh 10.0.0.11[email protected] ' s password: last login:  thu jan 19 15:00:41 2017 from 04[[email protected] ~]# ll / TMP total usage  2888drwx------ 2 amos     amos         4096 1 Moon   18 16:55 AMOS-RW------- 1 root      root        3879 1 Month   19 15:03  Sshd_config









This article comes from "Plum blossom fragrance from bitter cold!" "Blog, be sure to keep this provenance http://daixuan.blog.51cto.com/5426657/1893177

SSH logon failure due to permission error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.