gpt4 book ai didi

linux - 如何在 GCP 上的 Ubuntu 18.04 上的/etc/ssh/sshd_config 中添加 MAC 和 KEX 算法

转载 作者:行者123 更新时间:2023-12-04 19:06:22 26 4
gpt4 key购买 nike

我在 GCP 上的 Ubuntu 18.04 计算实例的/etc/ssh/sshd_config 中添加了以下 MAC。但是在更新文件后 ssh 没有重新启动并且 journalctl -xe 显示/etc/ssh/sshd_config 第 130 行:Bad SSH2 mac spec。

MACs hmac-sha1-512-etm@openssh.com,hmac-sha1-512-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
当我尝试重新启动 ssh 时,我看到以下错误:
$ sudo systemctl restart ssh
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.

$ journalctl -xe
--
-- Unit ssh.service has begun starting up.
Aug 02 11:37:17 ubuntu1804 sshd[23779]: /etc/ssh/sshd_config line 130: Bad SSH2 mac spec 'hmac-sha1-512-etm@openssh.com,hmac-sha1-512-etm@openssh.com,umac-128-etm@open
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Control process exited, code=exited status=255
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Failed with result 'exit-code'.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has failed.
--
-- The result is RESULT.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit ssh.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Stopped OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has finished shutting down.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Start request repeated too quickly.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Failed with result 'exit-code'.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has failed.
--
-- The result is RESULT.

以下是我从现有 ssh session 注销后尝试连接时收到的错误。
ubuntu1804> gcloud compute ssh ubuntu1804 --zone us-east1-b
ssh: connect to host 35.237.57.183 port 22: Connection refused
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
我在谷歌云文档中没有找到关于这个的任何线索。我可以修复服务器,但我想知道在 GCP 上的 Ubuntu linux 上的 sshd_config 中添加此类配置的正确方法是什么。

最佳答案

使用 ssh -Q mac 验证 MAC 的可接受值.我假设 hmac-sha1-512-etm@openssh.comhmac-sha1-512-etm@openssh.com不会在那里。

关于linux - 如何在 GCP 上的 Ubuntu 18.04 上的/etc/ssh/sshd_config 中添加 MAC 和 KEX 算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68622837/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com