How to Disable SSH Password Authentication on Linux VPS
Are you concerned about the security of your server? Using password authentication for SSH may not be as safe as you think. If a hacker gets hold of your SSH password, your valuable information is at risk. In this tutorial, we’ll show you how to disable password authentication for SSH on your Linux VPS, making your server much safer.
What You’ll Need
- A working Linux OS based server / VPS
- Root access to your server / VPS via SSH command line
Step 1 — Configuring SSH Key Authentication on Your Server
Before we begin, it’s important to set up another authentication method, such as SSH Key authentication, before disabling password authentication. This ensures that you won’t get locked out of your own server. Once you’ve configured your SSH Keys, you can proceed with this tutorial.
Step 2 — Editing SSH Configuration File
Before proceeding with this step, make sure you have completed Step 1 and successfully connected to your VPS using SSH keys. Follow these steps:
- Connect to your server/VPS with root SSH credentials.
- Open
/etc/ssh/sshd_config
configuration file with a text editor like nano or vim via SSH command line. Run the command:nano /etc/ssh/sshd_config
- Find the line
PasswordAuthentication yes
and change it toPasswordAuthentication no
. - Save the changes and exit by pressing Ctrl + X, typing in Y, and pressing Enter.
- Restart the SSHD service to apply the changes. Run the command:
service sshd restart
That’s it! SSH password authentication has been disabled on your server. Now, only privileged users with SSH keys or other advanced authentication methods will be able to connect.
Conclusion
By following this tutorial, you have successfully disabled SSH password authentication on your Linux VPS. This significantly improves the security of your server, as no one will be able to connect via SSH using a password. Only privileged users with SSH keys or advanced authentication methods will have access. Stay safe!
👉
Start your website with Hostinger – get fast, secure hosting here 👈
🔗 Read more from MinimaDesk:
- How to Disable xmlrpc.php in WordPress: A Step-by-Step Guide
- The Ultimate Guide to WP-Content: Access, Upload, and Hide Your WordPress Directory
- 40 Essential WordPress SEO Tips to Boost Your Website’s Rankings
- How to Add and Customize RSS Feeds in WordPress
🎁 Download free premium WordPress tools from our Starter Tools page.