How to configure localhost on Linux? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm trying to set up a virtual machine with CentOS 7 to use it as an Oracle Database Server (I'm new to Linux). I have encountered a problem about the host configuration that as I was reading has to be configured previously.
You see, this is where I collide with my knowledge that I have in windows. I thought it was enough to change the device name like this:
[root#localhost.localdomain ~] # hostname SERVER01
[root#localhost.localdomain ~] # hostname
SERVER01
[root # SERVER01 ~] #
And I do not understand why from windows I can not ping the Linux machine only using its hostname (SERVER01)
The ping request could not find host SERVER01. Check the name and
try again.
I understand that the previous configuration of the host in CentOS 7 that I am asked to install the database server has to do with the fact that I can not ping it using SERVER01. Although I have to clarify that using the IP if I can.
What do I do to make that change in Linux and can ping only using the hostname as it happens in windows?

When you change the hostname in linux you are essentially just telling the OS "this is your name".
In order to reflect that on the network mapping as well, you need to edit the hosts file:
nano /etc/hosts
or if you are a vi fan:
vi /etc/hosts
Note that you will need root access to do this.
In that file you can just extend the localhost mapping to also include your custom hostname SERVER01
127.0.0.1 localhost.localdomain localhost SERVER01
Once you do this, from the same CentOS terminal you can type ping SERVER01 and it should give you a proper ping results.
If you want to be able to ping and access the services on that virtual machine from your Windows OS, then you will need to do the same mapping through the hosts file on your Windows, but this time you will have to use the IP provided to the vm, instead of 127.0.0.1.

Related

Ubuntu server can be accessed from two hostnames [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
in our company we have a Ubuntu 16.04.5 server, where we keep our intranet website and some other simple sites. All works good, but we can access the server using two names like - http://server/website/ and http://server1/website/ . I checked all apache2 files and all host files and I did not find anything related to the name server1, only hostname server. Maybe someone can help me figure out where something like this is configured on how to turn it off.
For me this is normal situation. You have configured one site on this machine. But your DNS server have two records for the IP of the machine. And when you reach apache via first hostname you get the site as it is defined. When you reach the machine via second hostname apache check the hosts defined and see there is no special definition for this hostname and serve the request with first configured host.

SSH connect to remote on local network [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have 2 computers on linux (ubuntu like), both are on separated local networks (192.168.xxx.xxx).
I would like to connect through ssh to Linux2 from Linux1 but it doesn't have any public IP.
I have also a public server (srv.domain.com)
I suppose that both PC could connect to server and it would be able to forward commands ??
But I can't figure out how to do that. Is someone already did something similar and can explain it to me.
I have root access on all machines
Thanks a lot for your help !!!
The easiest way would be to make the firewall/router allow ssh connections between the hosts. But there is another way:
If your server can reach both clients, you can ssh onto the server and redirect a port to the ssh on the other machine:
ssh -L 1234:CLIENT2:22 -l USERNAME SERVERNAME
after logging into the the machine open another terminal window and enter:
ssh -l USERNAME -p 1234 localhost
USERNAME should be replaced with the username on the server/second
client.
CLIENT2 should be replaced by the ip or hostname of the
second client.
SERVERNAME should be replaces by the name of your
server.
You can also ssh onto the server and open another ssh session from there. But that would be to easy ;)
If your server cannot reach the clients you have to build the tunnel the other way round:
ssh -R 1234:22 -l USERNAME SERVERNAME
after logging into the the machine open a terminal window on the other machine and enter:
ssh -l USERNAME -p 1234 SERVERNAME
USERNAME should be replaced with the username on the server/second
client.
SERVERNAME should be replaces by the name of your
server.

Ifconfig doesn't provide any Details on Kali Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Folks,
I have Kali linux running on VM machine..there are 2 interfaces configured on this machine..1 interface is configured as "share with my Mac" and the other interface is configured as "Private to Mac".And i believe "private to Mac" option will allow me to connect my VM linux machine to the local machine.... ifconfig command doesn't show any output. i have manually configured the IP address to both interface by editing vi /etc/network/interfaces and restarted the network services using the command "/etc/init.d/networking restart"...but still ifconfig doesn't give any result....
Actually i want to communicate on port ssh from my local machine to the linux vm machine..since the machines do not communicate each other.i am not able to work anymore..Can someone please have a look in this issue and let me know what changes are required to complete my requirement...
Have you tried sudo ifconfig ? If it doesn't work the problem could be the drivers of your network card. I'm not sure this will works but you can watch this tutorial How to install network card to Kali

how to copy files on windows host from linux host [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
here is a window host ip is 192.168.8.1
i can telnet in this host from linux host 192.168.2.1 and name/pwd is test test
i want a shell script to login in window host(192.168.8.1),and copy d:/log to f:/log.
from linux host ,how to write this linux script .
I hava already tried to think,thank you for you to answer it.
You can install an ssh server on windows (for example OpenSSH)
Here a link of a tutorial: http://www.worldgoneweb.com/2011/installing-openssh-on-windows-7/
Then you can use the scp command from linux machine to copy your files. http://linux.die.net/man/1/scp
I would first ask if you have any other access to the windows host? Does it have a ftp server?
Is it or can it share drives? Assuming you need to transfer the file via the telnet session stream you can check out Kermit. It was originally written to work on serial lines, but can also work with telnet sessions. A version of kermit needs to be installed on both windows and linux. It works with binary files. It also changes line endings if needed. Another possibility is zmodem.
Old versions of kermit are public domain. Should be Ok. Newer versions are not. See http://www.omen.com/zmdmev.html

connecting Ubuntu to windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have installed Internet Information Services on windows and Apache on "Ubuntu" using apt-get command to install . "Ubuntu" is being run in my virtual box. now i want to connect these two computer together for which i opened fire fox on Ubuntu and entered my windows "IP address" in the address bar .windows firewall is off.
i ran # /etc/init.d/apache2 start to start Apache as well
Result: link of Microsoft.com/web with a huge IIS 8 on the page .what is wrong ?how can i fix this?
I don't really get what you are trying to do, but when you write the IP of a computer running either IIS or Apache, you should see a home page, probably the default one if you had never change it.
What are looking forward to do exactly?
In IIS the default html file is located in c:\inetpub\wwwroot\index.html
In Apache you should find httpd.conf file, it has the route to the default website, which probably is /www/index.html or something like that

Resources