---
title: SSH服务重启失败，提示：ssh.serviceJob for ssh.service failed
description: "重启SSH服务失败，提示如下："
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Appendices/faq/faq_0011.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Appendices/faq/faq_0011.html
indexId: 93d65e0df0dab02206d9540400648955b5f02ef5a226f60ce6b5de4317ea5cc574
---
# SSH服务重启失败，提示：ssh.serviceJob for ssh.service failed

#### 现象描述

重启SSH服务失败，提示如下：

```
# /etc/init.d/ssh restartRestarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xeu ssh.service" for details.  failed!
```


#### 解决方案

通过/usr/sbin/sshd -T命令查看发现是权限问题。提示如下：

```
# /usr/sbin/sshd -T
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/etc/ssh/ssh_host_ed25519_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
sshd: no hostkeys available -- exiting.
```

通过修改权限解决。步骤如下：

1. 登录开发者套件。
2. 修改权限。

```
chmod -R 600 /etc/ssh/*
```


3. 重启SSH服务。

```
/etc/init.d/ssh restart
```


  显示如下信息时表示SSH服务重启成功。

```
Restarting ssh (via systemctl): ssh.service.
```
