🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Xshell 8 VPS Connection Tutorial: Complete Guide to Remote Login to Linux Server from Windows (2026 Update)

Previously, we sharedBeginner-friendly VPS management software Xshell, here we will also introduce how to manage your VPS through Xshell 8. (Note: If you are using a Mac computer, you don't need to install Xshell, directly use the terminal and enter ssh root@your_IP to connect.)

I. Preparation (Must-Read Before Connecting)

Before starting to connect to VPS with Xshell, please confirm you have prepared the following information:

Information ItemDescriptionHow to Obtain
Server IP AddressPublic IPv4 address of the VPSCheck in provider's control panel
SSH PortRemote connection portDefault is22, some providers may modify it
UsernameLogin UsernameUsuallyroot
PasswordLogin passwordSet when purchasing VPS, or reset via control panel
Xshell ClientSSH connection toolDownload free version from official website

If you don't have a VPS yet, refer toVPS Recommendations to purchase one first; you can get a cheap VPS for less than 100 yuan for a year.

II. Detailed Steps for Connecting to VPS with Xshell 8

1. Run Xshell.

After downloading and installing Xshell 8, run it. In the pop-up window, select „New“, fill in the corresponding content in the „Connection“ tab, as shown below:

Xshell 8 新建会话属性窗口

You can fill in the name and description arbitrarily. Just ensure the protocol selected is SSH,the host field contains the server IP, and the port is the correct SSH port (the default port is 22).

2. Switch to the User Authentication tab.

The default method is Password, which logs in via username and password. It's recommended to only save the username here, not the password. Of course, if your security requirements aren't high or you don't mind, you can also save the password, so you don't have to enter it manually each time.

用户身份验证设置 — 建议只保存用户名,不保存密码

Tip: The default username for VPS purchased from some providers is not root. For example, the default username for Ubuntu systems is ubuntu.

3. Click Connect and accept the host key

After filling in the details, click the Connect button. The first time you connect to the VPS, an SSH security warning about an unknown host key will appear. Click „Accept & Save“ to proceed, as shown below:

首次连接时的SSH安全警告 — 点击【接受并保存】

If this prompt does not appear, there are two possible situations:

  1. You entered the wrong server IP;
  2. Your website server is not blocked; it is inaccessible from within China.

Step 4: Enter the password and log in successfully

If you did not save the password earlier, a password prompt will appear. Enter the password and confirm (the password will not be displayed while typing).

After successfully connecting to the VPS, you will see an image like the one below, showing[root@英文 ~]#[ubuntu@英文 ~]$a similar prompt.

The remote SSH server rejected X11 forwarding request.

III. What You Can Do After Connecting to VPS

You have now successfully logged into the remote Linux server via Xshell and can execute various management commands in the command line:

  • Update the systemyum update -y(CentOS) orapt update && apt upgrade -y(Ubuntu)
  • Install the LNMP environment: Nginx, MySQL, PHP, and other website runtime environments
  • install Baota Panel: Provides a visual interface for server management, suitable for beginners to quicklyBuilding a WordPress Website
  • Configure the firewall: Usefirewalldufwto manage port openings

If you plan to build a website, it is strongly recommended to installBaota Panelfirst. You can then operate through the web interface without memorizing many Linux commands.

IV. Advanced Tutorial: Using SSH Key Login (More Secure)

The above tutorial teaches you how to log into the VPS using a password. Some VPS providers also require SSH key login. Key-based login is generally more secure, but it is more complex than password login for beginners. You can learn about it and then decide whether to use SSH key login.

What is key-based login?

It is similar to two people using a secret code. You generate a private key on your local computer and upload a public key to the server. When connecting, the two keys must match to allow you to log into the VPS.

Comparison ItemPassword login ✅ Recommended for beginnersKey-based login 🔒 Suitable for advanced users
Operation DifficultySimple, just enter username and passwordMore complex, requires generating/managing key files
SecurityAverage, passwords may be brute-forcedHigher, almost impossible to crack
Login experienceYou have to enter the password manually every timePassword-free, one-click connection
What if I switch computersNo impact, you can log in from any computerYou need to copy the private key file to the new computer, otherwise you cannot connect
What if I lose the keyIt's very troublesome, you need to reset it through the VPS console, or keep an alternative login method
Target audienceBeginners, those with only 1-2 VPS instancesUsers who manage multiple servers long-term and have high security requirements

For beginners, using password login is sufficient (provided your password is complex enough that brute force attacks are difficult to crack)

If you want to try key-based login, refer to the steps below:

  1. Generate a key pair in Xshell: Tools → User Key Manager → Generate (select RSA 4096)
  2. Upload the public key to the VPS: First log in to the VPS using password authentication, then paste the public key content into~/.ssh/authorized_keysfile
  3. Modify the Xshell session: Change the login method from Password to Public Key, and select your private key file
  4. Test the connection: After success, you can log in without a password

⚠️Important Reminder: If you decide to use key-based login,be sure to back up the private key file(recommend storing it in cloud storage or on a USB drive). If the private key is lost and there is no alternative login method, you may need to reset the entire SSH configuration through the VPS provider's console to log in again.

V. Common Xshell VPS Connection Issues (FAQ)

Xshell prompts "Connection failed" or "Could not connect to"?

This prompt usually indicates a network issue or incorrect port. The default SSH port is 22, but some providers, such as BandwagonHost, generate random ports by default for security. You need to enter the correct port to connect.
A network issue could mean your local network cannot reach the server, or the server is blocked by the Great Firewall of China. The best solution is to create a new server that is not blocked.

Prompt "Authentication failed, please try again" - wrong password?

This indicates an incorrect username or password. First, check if your username is root and the password is the VPS password. Some people mistakenly enter the username and password for the website where they purchased the VPS, causing this error.
Additionally, if you installed the Ubuntu operating system, the default username should be ubuntu.

Garbled Chinese characters after successful connection?

In the tutorial, on the interface of step „2. Switch to the User Authentication tab“, switch to the Terminal tab, change the encoding to UTF-8, save it, and then reconnect to the VPS. It will work normally.

What is the difference between Xshell 8 Free Edition and Paid Edition?

The paid version comes with a commercial license and has no limit on the number of tabs. For personal website building and learning, the free version is fully functional.

Are the tutorials for Xshell 6/7/8 universal?

Yes, they are universal. At most, the software interface may change, but the operation methods are the same.

Below are Xshell articles you might need:

加我微信

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: