How To Ssh Into Ubuntu VM Virtualbox From Host Machine

preview_player
Показать описание
How To Ssh Into Ubuntu VM Virtualbox From Host Machine
- SSH, Secure Shel also known as Secure Socket Shell, is a network protocol that gives system administrators, a secure way to access a computer over an unsecured network
- How to install openSSH server on Ubuntu
sshd : is the OpenSSH server process. It listens to incoming connections using the SSH protocol and acts as the server for the protocol. It handles user authentication, encryption, terminal connections, file transfers, and tunnelling.
Let's start to install openssh-server.
- First update the system
$ sudo apt update
$ sudo apt upgrade

- To install openssh-server package, run:
$ sudo apt install openssh-server
- Once installed, the SSH service should be started automatically. If necessary, you can start (or stop, restart) the service manually via command:
$ sudo service ssh start
- Verify that ssh service running
$ sudo systemctl status ssh

- Configure firewall and open port 22
Before enabling the UFW firewall we need to add a rule which will allow incoming SSH connections. If you’re connecting to your server from a remote location, which is almost always the case and you enable the UFW firewall before explicitly allow incoming SSH connections you will no longer be able to connect to your Ubuntu server.
To configure your UFW firewall to allow incoming SSH connections, type the following command:

$ sudo ufw allow ssh

- Now we can enable UFW firewall by typing:
$ sudo ufw enable

- You can check the status of UFW with the following command:
$ sudo ufw status

- SSH to a VM VirtualBox
The best way to login to a guest Linux VirtualBox VM is port forwarding. By default, you should have one interface already which is using NAT Network.
Then go to the File - Preferences (Ctrl+ G), Select Network and Edit NatNetwork1,
Click on the Port Forwarding button.
Add a new Rule. As value :
rule name = "ssh", "Protocol' = "TCP", ”Host IP” =127.0.0.1, "Host port" = 2222, “Guest IP” = 172.168.1.200, "Guest port" = 22.

This way, we can point putty or MobaXterm to Port 22 of 127.0.1.1 and VirtualBox will redirect this connection to our VM where its ssh daemon will answer it, allowing us to log in.
In my case I use putty, To SSH into the guest VM

=====================================
LIKE || COMMENT || SHARE || SUBSCRIBE!
=====================================

↬ Twitter:
----------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Thank you so much, as you resolve my problem.

pinakimukherjee
Автор

Video này xịn vãi. Nghìn like luôn nha

phuclethanh
Автор

Hi, what if we turn the system to "save status" will it still works ?

ahmedahmedx
Автор

didn't work for me. in the port forwarding you don't have to add any ip, they will be added automatically

TheONEHD
Автор

what password you are using. For me, the password is not working, and not able to understand the guest IP. From where did you get the IP

nilanjanmandal