Can anyone explain .ssh/ contents?

P

postcd

Guest
-rw------- 1 root root 2.1K Nov 7 18:15 authorized_keys
-rw------- 1 root root 1.7K Nov 7 06:01 id_rsa
-rw-r--r-- 1 root root 405 Nov 7 06:01 id_rsa.pub
-rw-r--r--. 1 root root 1.2K Nov 6 07:41 known_hosts

what is each file good for please?
 


They are for ssh to use, in general, they're not really for the end-user.
 
I'm pretty sure known_hosts is created/appended to when connecting to the server.

id_rsa and id_rsa.pub is created by running ssh-keygen on the client then you would cat id_rsa.pub to authorized_keys2 on the server so in the future a password would not be needed.

Not having to enter a password is generally useful for syncing files to the server using rsync via ssh.

authorized_keys must have been created with an older version of ssh-keygen because it now creates authorized_keys2 or sshd_config was modified to accept the authorized_keys file.
 
-rw------- 1 root root 2.1K Nov 7 18:15 authorized_keys
> > > These are the public keys from other computer systems. You can revoke access by removing the lines in the file that pertain to the remote system.

-rw------- 1 root root 1.7K Nov 7 06:01 id_rsa
> > > This key is your private key, do not share it with anyone. I'll explain why in the next file.

-rw-r--r-- 1 root root 405 Nov 7 06:01 id_rsa.pub
> > > This key is your public key. Without the private key, you cannot access servers containing your public key. Anyone that has the private key can gain access into systems with the public key setup.

-rw-r--r--. 1 root root 1.2K Nov 6 07:41 known_hosts
> > > These are your trusted connections. If an IP address changes of a remote system (For instance, let's say you've authenticated with domains and not an IP address), you will receive a warning and should proceed with caution if the IP of the domain changes. In some cases, depending on your configuration, your system will deny you connecting to the remote system if there's a mismatch.
 

Members online


Top