Article directory
Can't connect to Vultr VPS SSH?
PuTTY key generation setup method
Because many Chinese netizens use Vultr VPS to build "科学Internet" channel, so a large number of Vultr's IP addresses were blocked...
Detect IP address
First of all, you must confirm that you created the IP address of Vultr. Can you access it in mainland China as usual?
Solution:
- Use an online ping tool to detect IP addresses ▼
What should I do if my Vultr IP address is blocked in mainland China?
- Please see this article for the solution ▼
SSH key login
While the VPS is exposed to the internet, someone will continue to brute force your SSH password to log in.
So it is necessary to log in with SSH keys, and turn off password login.
Use the following command to view other people's brute force logins for your SSH password:
grep "Failed password for invalid user" /var/log/secure | awk '{print $13}' | sort | uniq -c | sort -nr | more
For our own purchased VPS, brute force up to thousands of times!You can go and see how many times you have been brute-forced yourself.
Solution:
- Change the SSH password login mode to SSH key login mode
SSH key generation
If it is a Windows system, you need to use puttygen softwareto generate a key pair.
Linux and MacOS systems can be run directly from the terminal:
Step 1:Generate SSH keys
Please run this command ▼
ssh-keygen -t rsa -b 4096
Step 2:Enter the file location to save the key
Enter file in which to save the key (/root/.ssh/id_rsa):
- Please press Enter
Step 3:You will be asked to enter a password
Enter passphrase (empty for no passphrase): Enter same passphrase again:
- Enter a password, or you can simply press Enter and leave it blank.
At the end you will see a message that your private and public keys are stored there:
Your identification has been saved in /root/.ssh/id_rsa. <== 私钥 Your public key has been saved in /root/.ssh/id_rsa.pub. <== 公钥
Vultr VPS Configure SSH
When Vultr creates a VPS, you can directly set up SSH key login.
If you've created a VPS but haven't set up SSH keys...
Please follow the steps below after running the above "SSH key generation" on Linux:
Step 1:will id_rsa.pub
put into a /root/.ssh
directory and rename it to authorized_keys
Step 2:modify /etc/ssh/sshd_config
Configuration file
RSAAuthentication yes #RSA认证 PubkeyAuthentication yes #开启公钥验证 AuthorizedKeysFile .ssh/authorized_keys #验证文件路径 PasswordAuthentication no #禁止密码认证 PermitEmptyPasswords no #禁止空密码
Step 3:Restart the SSH service
- Centos7 Use the command:
systemctl restart sshd
- Centos6 use the command:
/etc/init.d/sshd restart
PuTTY generates keys
If you log into the VPS using a Windows system, you will need to download the private key to the client and convert it to the format used by PuTTY.
- Don't have PuTTY software installed on your computer?Please Google or Baidu search: Download PuTTY.
Step 1:Using WinSCP, SFTP or other tools, transfer the private key file id_rsa Download to the client.
Step 2:Open PuTTYGen.exe
Step 3:Click the Load button in Actions ▼
Step 4:Load the private key file you just downloaded
Unable to display private key file?Please select "All file (*.*)" ▲
- If you just set a password lock, you need to enter the password at this time.
- After a successful load, PuTTYGen will display information related to the key.
Step 5:Click the Save private key button to save the private key file format available to PuTTY ▼
How to set up Putty?
The following is to set Putty to log in with Private keyLinuxServer method:
Step 1:Putty → Session: Fill in the Host Name (Or IP Address)
Step 2:Putty → Connection → Date: Fill in Auto-login username: root
Step 3:PPutty → Connection → SSH → Auth: Select the private key file just generated by PuTTYGen in Private key file for authentication ▼
Step 4:Go back to Putty → Session: Saved Session, fill in the name to save, and then double-click the name to log in directly.
Step 5:You can log in to Linux without a password in the future, please remember to save your Private key key file.
To obtain the remote login Linux tool software on Android mobile phones, please click this link to view ▼
Extended reading:
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Can't connect to Vultr VPS SSH? PuTTY Key Generation Setting Method", will help you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-646.html
Unlock AI assistance and say goodbye to inefficient work! 🔓💼
🔔 Get the "DeepSeek Prompt Word Tool" immediately in the channel pinned directory! 🎯
📚 Miss out = Fall behind forever! Act now! ⏳💨
If you like it, please share and like it! Your sharing and likes are our continuous motivation!