大网数据广告活动
服务器运维问答

Can I restore a sshd_config file on esxi 5.5 without being able to SSH in?

· 52CE 我爱测

I've looked and tried to find a way but I'm unsure of how to get LOCAL shell access on an ESXI machine. I broke the sshd_config with the following change to the sshd_config file: # Default > MACs hmac-sha1,hmac-sha1-96 MACs hmac-…

问题原文

原帖链接 · parsecpython · CC BY-SA 4.0

I've looked and tried to find a way but I'm unsure of how to get LOCAL shell access on an ESXI machine.
I broke the sshd_config with the following change to the sshd_config file:

# Default > MACs hmac-sha1,hmac-sha1-96
MACs hmac-sha2-256,hmac-sha2-512,hmac-sha1

After making that change, then restarting the ssh service:

$ ssh -l root 10.240.19.22
ssh_exchange_identification: Connection closed by remote host

$ ssh -l root 10.240.19.22 -vvv
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/user/.ssh/config
debug1: /Users/user/.ssh/config line 1: Applying options for *
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname 10.240.19.22 is address
debug2: ssh_connect_direct
debug1: Connecting to 10.240.19.22 [10.240.19.22] port 22.
debug1: Connection established.
debug1: identity file /Users/user/.ssh/id_rsa type -1
debug1: identity file /Users/user/.ssh/id_rsa-cert type -1
debug1: identity file /Users/user/.ssh/id_dsa type -1
debug1: identity file /Users/user/.ssh/id_dsa-cert type -1
debug1: identity file /Users/user/.ssh/id_ecdsa type -1
debug1: identity file /Users/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/user/.ssh/id_ed25519 type -1
debug1: identity file /Users/user/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/user/.ssh/id_xmss type -1
debug1: identity file /Users/user/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host

any thoughts for recovery? Thanks!

已采纳解答

原帖链接 · David O. · CC BY-SA 4.0

I think the only way to do this would be to treat the remote server as a local one:

  1. Get ILO/IPMI/KVM access to the remote server,
  2. Reboot
  3. When you reach the management console, launch a local shell as follows:

https://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vcli.migration.doc_50%2Fcos_upgrade_technote.1.4.html

  1. Make your edits to sshd.conf and restart the service.
  2. Test remote SSH.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。