Notice

: Function WP_Styles::add was called incorrectly. The style with the handle "hello-elementor-child-style" was enqueued with dependencies that are not registered: hello-elementor-theme-style. Please see Debugging in WordPress for more information. (This message was added in version 6.9.1.) in /home/csrkub/domains/cube-vps.com/public_html/wp-includes/functions.php on line 6131

Notice: Function WP_Scripts::add was called incorrectly. The script with the handle "gpress-custom-js" was enqueued with dependencies that are not registered: gpress-siema. Please see Debugging in WordPress for more information. (This message was added in version 6.9.1.) in /home/csrkub/domains/cube-vps.com/public_html/wp-includes/functions.php on line 6131

*Cube-Host– full cloud services!!

Connecting to Linux VPS via SSH

Connecting to Linux VPS via SSH

What you will need

  • VPS IP address, login (usually root or a user with sudo), SSH port (default is 22).
  • SSH client:
    • Windows 10/11: built-in OpenSSH in Windows Terminal / PowerShell / CMD (recommended) or PuTTY.
    • macOS / Linux: pre-installed ssh in Terminal.

Option A — quick connection using a password (Windows/macOS/Linux)

Command (replace user and 1.2.3.4 with your own values):


					
				

When you log in for the first time, confirm the host key (yes), then enter your password.
Basic client and authentication options are described in the OpenSSH manual.

Linux VPS

Option B — Key-based protection (recommended)

Step 1. Generate a key pair on your PC

In Windows 10/11, open PowerShell and run:


					
				

The keys will appear in C:Users<name>.ssh (or ~/.ssh on macOS/Linux): private — without extension (keep secret), public — .pub (copy it to the server).

Linux VPS

Details on generating keys in Windows: Microsoft/phoenixNAP/HowToGeek.

Step 2. Upload the public key to the server

Method 2.1 — automatically (if password access is available):


					
				

The utility will add the key to ~/.ssh/authorized_keys and set the permissions.

Method 2.2 — manually (via password login):


					
				

Don’t get confused: only .pub goes to the server; we never copy the private key. Permissions .ssh = 700, authorized_keys = 600 (otherwise you will get Permission denied (publickey)).

Linux VPS

Step 3. Connect using the key


					
				

To avoid entering the parameters each time, add the profile to ~/.ssh/config:


					
				

Now, ssh myvps is sufficient. Documentation on ssh_config (all key parameters — Host, User, Port, IdentityFile).

Option C — via PuTTY (Windows), if GUI is more convenient

  1. Download and run PuTTYSession tab → specify Host Name (IP/domain), Port=22, Connection type=SSHSaved SessionsSaveOpen.

Linux VPS

2. If you are logging in with a key: PuTTYgen → upload your private key or create a new one → save in .ppk format, then in PuTTY: Connection → SSH → AuthPrivate key file for authentication — select .ppk.

3. (Optional) Log in to the session and save the profile so you don’t have to enter the parameters every time.

Verification and basic configuration

Check the availability of port 22 from your PC:


					
				

Permission denied (publickey) → check:

  1. whether the public key (.pub) has been transferred to the server,
  2. the permissions for ~/.ssh (700) and authorized_keys (600),
  3. whether IdentityFile matches locally.

Enhancing server security (after configuring keys)

Open /etc/ssh/sshd_config and check (or add) the lines, then restart sshd:


					
				

Supported key directives and algorithms are described on the man page sshd_config/ssh_config.

Copying files

SCP:


					
				

SFTP (interactive):


					
				

(Both methods are included in the OpenSSH client package.)

Table of Contents

 

Prev