elma.dev - Can ELMA 10月02日
虚拟机SSH连接设置指南
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了如何在VirtualBox上设置虚拟机的SSH连接,包括网络配置和SSH服务启动等步骤。

You have a virtual GNU/Linux or Windows machine on VirtualBox and want to establish an SSH connection with it. Here's what you need to do.

Terminology:
host: Your own machine running VirtualBox.
guest: The virtual machine you created on VirtualBox

Steps

    Shutdown the guest OS if it's already running.

    Open the settings screen of the guest machine on VirtualBox and navigate to the Network section.

    In the Adapter 1 tab, set the Attached to to NAT.

    Expand the Advanced settings below and click on the Post Forwarding.

    Using the + button, create a new rule with the following values.

      Name: <name>Protocol: TCPHost IP: <empty>Host Port: 3987Guest IP: <empty>Guest Port: 22

    Save and close. That's all for setting up the network.

    Run your guest machine and let its operating system start.

    Using the appropriate command according to your operating system, start the sshd service. E.g., systemctl start sshd on a GNU/Linux distribution with systemd.

    Try to connect to the guest via SSH: ssh root@localhost -p 3987

In this way, your SSH connection on the port 3987 will be forwarded to your guest machine's SSH port.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

VirtualBox SSH连接 网络配置
相关文章