安装sshserver后/etc/ssh/没有ssh_config
时间: 2024-05-19 19:09:27 浏览: 17
如果你在安装SSH Server后无法在`/etc/ssh/`目录下找到`ssh_config`文件,这可能是因为你的SSH Server安装的是较新版本的OpenSSH,而OpenSSH在较新版本中已经将`ssh_config`文件移动到了`/usr/local/etc/ssh/`目录下。你可以前往该目录查找。
如果你仍然无法找到`ssh_config`文件,你可以尝试在命令行中使用以下命令来查找文件:
```
sudo find / -name ssh_config
```
该命令将会在系统中查找`ssh_config`文件并输出它们的路径。如果你在系统中找不到该文件,则可以通过重新安装SSH Server来尝试解决该问题。
相关问题
/etc/ssh/sshd_config配置 sshfs
/etc/ssh/sshd_config 是 SSH(Secure Shell)服务器的主配置文件,它定义了 SSH 服务的许多关键参数和设置。当你使用 SSHFS (SSH 文件系统) 时,这个配置文件对 Mount 点的设置尤其重要,因为它影响到如何通过 SSH 协议挂载远程文件系统。
以下是一些与 SSHFS 相关的 sshd_config 配置选项:
1. **Subsystem**:SSHFS 可以作为子系统被配置在 sshd_config 中,例如:
```
Subsystem sftp internal-sftp
Subsystem sshfs /usr/libexec/openssh/sftp-server
```
这里指定了 `sftp` 和 `sshfs` 子系统对应的路径。
2. **PasswordAuthentication**:如果开启了密码验证,用户可以通过 SSH 登录然后使用 `sshfs` 命令挂载远程目录。
3. **PublickeyAuthentication**:如果你希望只允许公钥认证,可以禁用密码验证并配置 `PubkeyAuthentication yes`.
4. **HostKeys**:确保SSH主机密钥的配置正确,以保证客户端能够正确识别服务器。
5. **PermitRootLogin**:对于 root 用户的 SSHFS 访问权限,可能需要调整这一项。
6. **UserKnownHostsFile** 和 **StrictHostKeyChecking**:控制SSH如何处理新主机的主机密钥验证。
7. **AuthorizedKeysPath**:指定用户公钥的存储位置,以便在 SSHFS 中使用。
/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.
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)