Check existing SSH Key on server

March 2, 2017 103 views
DigitalOcean Development CentOS

Hello all..

Im running centos 7 on my server, and I run command:
[root@srvr ~]# ls -al ~/.ssh

and get this result:
total 12
drwx------ 2 root root 4096 Feb 24 14:36 .
dr-xr-x---. 13 root root 4096 Mar 2 03:46 ..
-rw------- 1 root root 418 Mar 1 13:50 authorized_keys

Can someone explain what is the command function and the result mean?

The result show total 12, I wonder, is my server had 12 SSH key?
Because I only insert 1 ssh key from my laptop.

Thank u all..

1 Answer

The first line when using the list option of ls -l will show the amount of disk blocks being used. It's "physical" space on the hard disk, would probably be the simplest answer.
You can run the command info coreutils ls to get a very detailed explanation of every option and the output.

Your authorized keys is located in the file called, well, authorized_keys
If you show the content of that file, it'll tell you all the keys. One key per line.
https://help.ubuntu.com/community/SSH/OpenSSH/Keys

Have another answer? Share your knowledge.