What is SSH

SSH stands for “Secure Shell Protocol”, which is a protocol and method for securely transmitting data over the network. The main purpose of SSH is to protect the security of data transmission through encryption technology, ensuring that sensitive information will not be stolen or tampered with by unauthorized persons when it is transmitted over the network.
In the previous article “Quick VPS Tutorial | Vultr” , we have learned how to register a VPS on Vultr.
In this article, we will focus on how to connect to your VPS via SSH.

Vultr - The Everywhere Cloud.

How to SSH into a VPS

We will use cmder (for Windows users) or Terminal (for Mac users) to connect. Here are the detailed steps:

  • The first method: Use cmder (for Windows users)
    Cmder is a powerful terminal emulator. Windows users need to install the SSH connection tool first, open the Cmder official website, and then click download full. Of course, you can also choose other SSH client tools, such as Xshell, PuTTY, etc.
Download Cmder from the official website
Download Cmder from the official website
  • The second method: Use Terminal (for Mac users)
    MAC users need to find the Terminal that comes with the system.

Whether you use Cmder or Terminal, the following steps are the same.

First open your Cmder or Terminal, and enter the following command:

ssh username@VPS_IP

Copy

The method of viewing username, VPS_IP, and password is mentioned in the article ” Quick VPS Setup Tutorial | Vultr “.

After pressing Enter, the system will ask you to confirm the connection. Please enter “yes” and press Enter.

Next, you will be asked to enter your VPS password, enter it and press Enter to confirm.

Connect to VPS and enter password
Connect to VPS and enter password

After the connection is successful, you will enter the command line interface of the VPS and can start subsequent operations.

SSH connection successful
SSH connection successful

FAQ

How to connect to the cloud server via private key?

Some cloud servers from hosting vendors require a private key to connect, such as Amazon EC2 hosts. Here’s how to connect using a private key:

  1.  When creating an ec2 host, you must create a key pair, and the private key file will be automatically downloaded to the local computer (needed to connect to the ec2 host)
  2. Use the private key to connect to the EC2 host
    (1) SSH connection on the Linux host
    ssh -i “ubuntu200402key.pem” [email protected]
    (2) Use OpenSSH software to connect on Windows
    ssh [email protected]
    Select Public Key, browse to import the private key file, and confirm the connection.
  3. Set the root user password
    After logging in to the ec2 host, set the root user login password
    sudo passwd root
  4. Modify the configuration file to allow the root user to log in
    on the ec2 host, set to allow the root user to log in
    vim /etc/ssh/sshd_config
    PermitRootLogin yes
    PasswordAuthentication yes
  5. Restart the ssh service to make the changes take effect.
    systemctl restart sshd

How to solve the problem that the cloud server cannot be pinged?

For security reasons, cloud servers provided by cloud host vendors generally do not allow pinging by default.
Taking Amazon EC2 host as an example, the host cannot be pinged because ping uses the ICMP protocol, which has nothing to do with the port. Therefore, the security group needs to configure the ICMP protocol.

Add a new inbound rule to the security group, Edit Inbound Rules – Add Rule, search for the protocol “All ICMP – IPV4”, select “All Locations IPV4” for the source, and then save the rule.

With these simple steps, you will be able to easily establish a secure connection to your cloud server via SSH. This will enable you to conveniently perform remote management and operations.

Leave a Reply

Your email address will not be published. Required fields are marked *