/etc/ssh/ssh_config: line 47: Bad configuration option: permitrootlogin /etc/ssh/ssh_config: line 48: Bad configuration option: permitemptypasswords /etc/ssh/ssh_config: terminating, 2 bad configuration option
时间: 2023-07-29 16:07:25 浏览: 111
这个错误信息表明您的SSH配置文件(/etc/ssh/ssh_config)中存在无效的配置选项。具体来说,第47行和第48行都有错误的配置选项:permitrootlogin和permitemptypasswords。
这些选项在SSH服务器的配置文件(/etc/ssh/sshd_config)中是有效的,但在客户端的配置文件中是无效的。
要解决这个问题,请打开SSH客户端的配置文件(/etc/ssh/ssh_config),找到并删除这两个无效的选项。然后保存文件并重新启动SSH服务。您可以使用以下命令来重新启动SSH服务:
```
sudo service ssh restart
```
这应该会解决这个问题。
相关问题
/etc/ssh/sshd_config
The /etc/ssh/sshd_config file is a configuration file for the OpenSSH server daemon (sshd). It contains various settings that determine the behavior of the sshd service, including:
- Port number: The TCP/IP port number on which the sshd service listens for incoming connections. The default is 22.
- Authentication methods: The authentication methods that are allowed for sshd connections, including password, public key, and keyboard interactive.
- PermitRootLogin: Whether or not the root user is allowed to log in via SSH. This is typically set to "no" for security reasons.
- Protocol version: The version of the SSH protocol that is allowed for incoming connections. The default is 2.
- HostKey: The location of the host key file used to identify the server to clients. This should be kept secure.
- AllowUsers/AllowGroups: A list of users or groups that are allowed to connect to the sshd service.
- X11Forwarding: Whether or not X11 forwarding is allowed for incoming connections.
- MaxAuthTries: The maximum number of authentication attempts that are allowed before the connection is terminated.
These are just a few examples of the many settings that can be configured in the /etc/ssh/sshd_config file. It is important to carefully review and configure these settings to ensure the security and proper functioning of the sshd service.
/etc/ssh/sshd_config空白
/etc/ssh/sshd_config是一个SSH服务器的配置文件。它包含了许多参数来控制SSH服务器的行为。根据您提供的引用内容,我们可以看到一些参数的修改建议,以解决"permission denied (publickey)"的问题。
- 首先,将PermitRootLogin参数从no修改为yes。这将允许root用户使用SSH登录。
- 其次,将PubkeyAuthentication参数从yes修改为no。这将禁用基于公钥的身份验证。
- 最后,在AuthorizedKeysFile参数前加上#,屏蔽掉这行。这将取消对.ssh/authorized_keys文件的使用。
这些修改将允许使用密码身份验证登录SSH服务器。请注意,在进行任何修改之前,请务必备份原始配置文件,以防万一需要恢复。