Currently, we are connecting to linux in a virtual environment by specifying the IP address from teraterm.
Host (T): 192.168.0.10
The connection is successful by inputting as.
This is not addressing
Host (T): localhost
I want to connect by specifying the host name like, so I want to know how to do it.
After investigating, it seems that it can be realized by adding to "/ etc/hosts"
I found out that.
Added to hosts, now
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.10 localhost
It is like this.
Now if you specify "localhost" and the host name on teraterm,
We interpret that it is possible to do the same as when "192.168.0.10" is specified.
I wasn't sure if the settings were reflected, so I restarted linux once.
Since it was "inet addr: 192.168.0.10" in ifconfig after rebooting,
The connection (host name is 192.168.0.10) from teraterm with the IP address specified was successful.
However, in a connection with a host name (host name: localhost)
The connection failed with a "connection refused" error ...
The cause has not been found, whether the method of adding to "/ etc/hosts" is incorrect, or whether there is other work to be done.
I would like to ask you what is missing. I look forward to working with you.
Answer # 1
If you are using teraterm, is the host windows?
If so, the file to be set is
C: \ Windows \ System32 \ drivers \ etc \ hosts
windows hosts editPlease check around. Editing is possible only with an editor executed with administrator privileges. )
192.168.0.10 ssh.localhostIn the form of
localhostLet's set a name other than the IP of the virtual machine.
(Even if the host side is Linux
localhost (IPv4)Do not set multiple names for)
Answer # 2
You have to set it in the hosts file on the host side, not on the guest side of the virtual environment.
- when i try to ssh with teraterm for learning linux, it says "cannot connect to host"
- linux - [awk] ① i want to store $0 in a variable ② i can't output with echo instead of print
- i cannot connect to linux (centos7) installed on virtulbox from the host machine by ssh
- Fun with connect function with timeout under Linux
- How to connect a Linux virtual machine to WiFi
- How to use ss command instead of netstat in Linux operation and maintenance
- How to connect linux using paramiko module
- linux - i installed centos8 on vmware but can't connect to the external network
- linux - specifying the number of times when a file to be opened by cat is specified with a wildcard
- linux - teraterm ssh authentication username password unknown
- linux - character search by specifying columns in shellscript
- linux - i want to connect to gitlab with ssh, but i get an error at git clone
- linux red hat78 i can't connect to the internet
- linux - i want to be able to connect to an external site from ping
- linux - can't connect to local centos8 via ffftp
- i want to connect from windows 10 to centos 7 with teraterm
- i want to output the linux command (tool?) to a file instead of the terminal
- linux - raspberry pi4 does not connect to the network
- linux - unable to connect to 127001