Issue
I created a public SSH key on my local computer and added it to my github account. Now I want to connect to my server (online) via terminal, in order to clone my git project to the server of my provider. In an online tutorial to connect they suggest:
ssh root@< IP-ADDRESS OF THE SERVERS>
But in my server settings I can online find the following data: SSH-Hostname,SSH-Username,SSH-Port,SSH Fingerprint
Is it possible to connect also with Hostname and Username? Because I cannot find the ip address of my provider.
Thank you
Solution
This isn't really on topic here (stackoverflow), but I'll put in a quick answer anyway: ssh makes a network connection to an ssh server, therefore ssh needs a network address for the server. This need not be an IP address, except for one other issue, which is that the ssh protocol is defined as a TCP protocol and TCP runs over IP (v4 or v6).
That said, almost all networking systems have a mechanism for translating a host name to a set of addresses (some of which may be IP addresses; others might be XNS or IPX or some such: see What is Address Family?). So you just need user@host
, and something—OS and/or library dependent—will look up the proper IP address. You can leave off the user@
part in some cases.
If (this is a pretty big "if") your system can't translate the host name to an IP address, or does it incorrectly, then you can resort to a raw IP address. This bypasses the translation step. If you don't trust your translation software, you can do this intentionally.
Answered By - torek Answer Checked By - Marilyn (WPSolving Volunteer)