我尝试在远程机器上启动我自己的 sshd 服务器实例(我不是 root 用户),但是失败了:
debug1: sshd version OpenSSH_4.3p2
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: setgroups() failed: Operation not permitted
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: rexec_argv[2]='-f'
debug1: rexec_argv[3]='sshd_config'
debug1: rexec_argv[4]='-h'
debug1: rexec_argv[5]='ssh_host_rsa_key'
debug1: rexec_argv[6]='-p'
debug1: rexec_argv[7]='55000'
debug1: Bind to port 55000 on ::.
debug1: Bind to port 55000 on 0.0.0.0.
Bind to port 55000 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.
我的 sshd_config 文件的一部分:
# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
Port 55000
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress
#ListenAddress ::
如果我取消注释监听器地址并使用任何 IP,显然是我自己的 IP(172.16.13.126),它会出现以下错误:
Bind to port 55000 on 172.16.13.126 failed: Cannot assign requested address.
Cannot bind any address.
答案1
Bind to port 55000 on 0.0.0.0 failed: Address already in use.
嘿,
正如 sshd 输出的倒数第二行所述,端口 55000 似乎已被另一个进程占用。您可以尝试在文件中配置另一个端口sshd_config
。此处的回复还很好地解释了如何以非特权用户身份运行 sshd:
我还没有尝试过,但是乍一看描述似乎很合理。