简体   繁体   English

SSH服务器以不接受连接的系统帐户启动

[英]SSH server started with a system account not accepting connections

I started a new SSH daemon with a config file with a non-standard port number. 我使用带有非标准端口号的配置文件启动了一个新的SSH守护程序。 Now if I start the SSHD as sudo I can SSH onto the host but if i start as a different system account, the daemon starts but the connections fail. 现在,如果我以sudo的身份启动SSHD,则可以SSH到主机上,但是如果以其他系统帐户身份启动,则守护程序将启动,但连接失败。 Does the SSHD always need to be started as root ? SSHD是否始终需要以root用户身份启动?

I made sure the SSHD is running, it just doesnt accept connections. 我确保SSHD正在运行,只是不接受连接。

It is not practical to run sshd as non-root. 以非sshd身份运行sshd是不切实际的。 sshd needs root privileges for sshd需要具有root特权

  • password authentication (only root can access /etc/shadow ) 密码认证(只有root可以访问/etc/shadow
  • binding to a port that is below 1024 绑定到低于1024的端口
  • calling setuid() in order to obtain the privileges of the user that has connected 调用setuid()以获得已连接用户的特权

If you use an unprivileged port and key-based only auth, you may be able to make it work, but you'll be restricted to connections with the user that is running sshd . 如果您使用非特权端口和仅基于密钥的身份验证,则可以使其正常运行,但是您将只能与运行sshd的用户建立连接。

There is a relevant discussion here: http://seclists.org/basics/2003/Aug/564 这里有一个相关的讨论: http : //seclists.org/basics/2003/Aug/564

Which port did you use? 您使用哪个端口? Ports below 1024 are privileged to Root only. 低于1024的端口仅享有“根”权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 与服务器的SSH连接(使用密钥) - SSH Connections To Server (Using Keys) 接受连接时Epoll TCP服务器停止运行 - Epoll tcp server grinds to a halt when accepting connections 使用本地系统作为 ssh 客户端和服务器 - Using local system as ssh client and server Linux不接受与端口25的连接 - Linux not accepting connections to port 25 TCP服务器不接受具有少量侦听积压的客户端发出的正确连接数 - TCP server not accepting right number of connections issued by client with small listen backlog 在接受连接之前或之后分叉? - Fork before or after accepting connections? linux 中的导轨。 服务器是否在主机“localhost”(::1) 上运行并接受端口 5432 上的 TCP/IP 连接? - Rails in linux. Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432? Postgresql:连接被拒绝 服务器是否在主机“127.0.01”(127.0.0.1)上运行并接受端口 5432 上的 TCP/IP 连接? - Postgresql: Connection refused Is the server running on host “127.0.01” (127.0.0.1) and accepting TCP/IP connections on port 5432? 在主动式 Web 服务器中接受连接的传统方式(使用异步 IO) - Conventional way of accepting connections in a proactive web-server (using asynchronous IO) 与PHP的SSH连接 - SSH connections with PHP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM