本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
确保对虚拟机实例的 SSH 访问的安全的最佳实践
如果您授予用户通过 SSH 连接到虚拟机 (VM) 实例的权限,则会影响虚拟机以及虚拟机有权访问的任何资源(例如存储桶或数据库)的安全性。
您可以遵循一些最佳实践来限制与 SSH 访问相关的风险,包括:
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-18。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eGranting users SSH access to virtual machines (VMs) can impact the security of the VM and resources it accesses.\u003c/p\u003e\n"],["\u003cp\u003eImplement zero trust access controls to limit the networks, locations, and devices from which SSH connections to VMs can be established.\u003c/p\u003e\n"],["\u003cp\u003eRestrict which users can establish SSH sessions and ensure timely revocation of login access.\u003c/p\u003e\n"],["\u003cp\u003eRequire multi-factor authentication and safeguard credentials to protect against leaks.\u003c/p\u003e\n"],["\u003cp\u003eMaintain a reliable audit trail to monitor all SSH access.\u003c/p\u003e\n"]]],[],null,["# Best practices for securing SSH access to VM instances\n\n*** ** * ** ***\n\nWhen you grant users access to connect to virtual machine (VM) instances using\nSSH, you impact the security of your VM and any resources that your VM has\naccess to, such as storage buckets or databases.\n\nYou can limit the risks related to SSH access by following several best practices,\nincluding:\n\n- [Control network access](/compute/docs/connect/ssh-best-practices/network-access):\n Implement zero trust access controls to restrict the networks, locations, and\n devices from which users can establish SSH connections to your VMs,\n and avoid VMs from being more exposed than necessary.\n\n- [Control SSH login access](/compute/docs/connect/ssh-best-practices/login-access):\n Restrict which users are allowed to establish SSH sessions and ensure that login\n access is revoked in a timely manner.\n\n- [Protect SSH credentials](/compute/docs/connect/ssh-best-practices/credentials):\n Require users to authenticate with multiple factors and protect credentials from\n being leaked.\n\n- [Audit SSH access](/compute/docs/connect/ssh-best-practices/auditing): Maintain a\n reliable audit trail that tracks all SSH access.\n\nWhat's next\n-----------\n\n- Learn more about the [best practices for controlling SSH network access](/compute/docs/connect/ssh-best-practices/network-access)"]]