Redhot series: CentOS Ssh connection software: TeraTerm Virtual machine: VirtualBox
How to access virtual local Linux with SSH
When accessing Linux using TeraTerm You must allow access from the outside.
"Set up CentOS network"
[Details]
Execute $ su-(space between su and-)
root privilege command
$su -
You will be asked for your password. password is the password to log in to the host user (login screen) If you successfully become the root user here The symbol ($) waiting for a command command changes to #.
Type the following command and press Tab instead of Enter.
# vi /etc/sysconfig/network-scripts/
Then, two patterns of screen display will appear, so it corresponds to each Please proceed with the pattern. (Tab key is a command that shows the next input candidate)
―――――――――――――――――――――――――――――― [Pattern 1]
For the above pattern, look for ifcfg- ○○ and ifcfg-lo describe ifcfg- ○○ after # vi / etc / sysconfig / network-scriprs /
# vi /etc/sysconfig/network-scriprs/ifcfg-○○
After filling in the above, press Enter to move to [Editing Procedure]. ――――――――――――――――――――――――――――――
[Pattern 2]
After filling in the above, press Enter to move to [Editing Procedure]. ―――――――――――――――――――――――――――――― [Editing procedure] The file to be edited this time is the ifcfg- ○○ file. By the way, ○○ is the setting file name of the network interface for connecting to the outside. It depends on the person, so you don't have to worry about it.
When the above screen appears, follow the steps below.
Select "Virtual Machine"> "File" at the top right of the screen
"Network"> "Advanced"> "Port Fording"
Add settings. Host port: 3333 Guest port: 22 (Port number to connect with SSH)
Reboot when the settings are complete
# reboot
Start TeraTerm
Host:127.0.0.1:3333 TCP post# : 22
Set the number added in the network settings
Select Continue
After adding "User name" and "Passphrase" Select OK (* User name and password of the host created "User name" and "Passphrase")
That's it.
Recommended Posts