How To Remove SSH Keys from Linux Server

NetShop ISP
2 min readJan 30, 2023

--

This article provides an easy, step-by-step guide on how to remove/delete SSH keys from a linux server.

Prerequisites

  • Steps in this article apply to Linux and BSD servers
  • You have one or more SSH Keys added on your server in OpenSSH format
  • You have ssh access on the server

Four Steps to Remove SSH Keys

  1. SSH to your server
    ssh <user>@<server ip>
  2. Edit file ~/.ssh/authorized_keys using your favorite editor (e.g. vi, nano, pico)
    vi ~/.ssh/authorized_keys
  3. Remove the line that corresponds to your key
  4. Save the file and exit (command below applies to ‘vi’ editor)
    Hit ‘Esc’ button, then type wq! and hit Enter

That’s it!

How To Assign SSH Key to your Linux VPS Server

Adding one or more SSH keys to your Linux VPS server can now be done easily, with the click of a button via myNetShop portal.

  • Login to https://my.netshop-isp.com.cy
  • Go to VPS management page
  • Click “SSH Keys” from the actions toolbar
  • Click “Add new SSH key” (or choose from existing)
  • Click on “Use SSH key” to assign your key to the VPS server

You can also refer to the article How To Enable SSH on Debian 11 Server if you wish to do the entire setup manually.

Source: https://netshop-isp.com.cy/blog/how-to-remove-ssh-keys-from-linux-server/

--

--

NetShop ISP
NetShop ISP

Written by NetShop ISP

Web Hosting, Servers, Colocation & Data Center Services (www.netshop-isp.com.cy)

No responses yet