Make an ssh connection from Mac / VirtualBox (CentOS)
1. VirtualBox settings
–Click [File] → [Host Network Manager]
–Click the create button to create 192.168.56.1
–Check the DHCP server and close it
–If you want to change other settings, change them in the properties.
–ssh Select the CentOS you want to connect to and press the setting button
–Select a network
Adapter 1 setting
Check Enable network adapter
Allocation: NAT
Adapter 2 settings
Check Enable network adapter
Allocation: Host Only Adapter
Name: vboxnet0 (select the one created by the host network manager)
Press OK to close the screen
2. CentOS settings
–Start CentOS
–Log in as root user and execute the nmtui
command
–Select “Edit a connection”
–Select ʻenp0s3 with the lower button, press the right button, select
<Edit …> and Enter
![スクリーンショット 2020-08-23 1.37.46.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/696107/f9907a2e-4664-d04d-bd3d-1da3c934f232.png)
--Set the following in Edit Connection and close with OK
--Changed IPv6 CONFIGURATION from Automatic to Ignore
--Check Automatically connect by pressing a space
![スクリーンショット 2020-08-23 1.44.17.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/696107/d4c42ce7-8092-6648-7da4-994b4fd2f402.png)
--Since it returns to the list, select the one with garbled characters this time, select the right button
<Edit …> and Enter
--Set the following in Edit Connection and close with OK
--Changed Profile name to ʻenp0s8
–Changed IPv4 CONFIGURATION from ʻAutmatic to
Manual
--ʻMove the cursor to <show>
of IPv4 and Enter
–Added 192.168.56.11/24
to Addresses
–Changed IPv6 CONFIGURATION from ʻAutomatic to ʻIgnore
–Check Automatically connect by pressing a space
–When you return to the list, move the cursor to Back and Enter
–When you return to NetworkManager TUI
, select Quit
and Enter
–Restart the network
# systemctl restart NetworkManager
# systemctl restart network
3. Ssh connection from Mac terminal
–Connect
# ssh [email protected]
Type yes if you are asked for anything
This completes the ssh connection settings
4. Reference
https://qiita.com/ryubb_SU/items/782fd6a0614d9855e3b4
https://qiita.com/ebkn/items/751ed657629ba8d4ab0a