Delete SSH Keys

Linux Lock An Account

# passwd -l userName
# passwd -l vivek

FreeBSD Local An Account

# pw lock userName
# pw local vivek

Solaris / HP-UX UNIX Lock An Account

# passwd -l userName
# passwd -l vivek

Remove SSH Keys

$HOME/.ssh/ stores all required keys. Simply rename the directory or delete the directory:
# mv /home/vivek/.ssh /home/vivek/nosshlogin
OR
# rm -rf /home/vivek/.ssh
For remote server edit $HOME/.ssh/authorized_keys or $HOME/.ssh/authorized_keys2 file and remove public key. This will delete login from home computer into your server. Finally, you can always delete user from your system using the pw (FreeBSD) or userdel (Linux / UNIX) command.

Was this answer helpful?

 Print this Article

Also Read

tcpdump: Monitor ALL eth1 Traffic Except My Own SSH Session

I'm using tcpdump to dump, debug and monitor traffic on a network. However, there is lots of...

nginx: Send Custom HTTP Headers

How do I send or set arbitrary HTTP headers using nginx web server? You need to use add_header...

Linux: Check For Memory Leaks In Programs

How do I check my C programs under Linux operating systems for memory leaks? How do I debug and...

How Do I Block an IP Address on My Linux server?

How do I block an IP address or subnet under Linux operating system? In order to block an IP on...

Changing Default SSH port From 22

nano /etc/ssh/sshd_configLook for#Port 22Change "22" to the port you wish to use.CTRL + X, Save...