LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-12-2014, 01:07 PM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
Can anyone explain .ssh/ contents?


-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?
 
Old 11-12-2014, 01:23 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
From the manpage on ssh:

Code:
The file ~/.ssh/authorized_keys lists the public keys that are permitted
     for logging in.  When the user logs in, the ssh program tells the server
     which key pair it would like to use for authentication.  The client
     proves that it has access to the private key and the server checks that
     the corresponding public key is authorized to accept the account.
...
(id_rsa)
identity_file
             Selects a file from which the identity (private key) for public
             key authentication is read.  The default is ~/.ssh/identity for
             protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and
             ~/.ssh/id_rsa for protocol version 2.  Identity files may also be
             specified on a per-host basis in the configuration file.  It is
             possible to have multiple -i options (and multiple identities
             specified in configuration files).  ssh will also try to load
             certificate information from the filename obtained by appending
             -cert.pub to identity filenames.
...
(id_rsa.pub)
The user creates his/her key pair by running ssh-keygen(1).  This stores
     the private key in ~/.ssh/identity (protocol 1), ~/.ssh/id_dsa (protocol
     2 DSA), ~/.ssh/id_ecdsa (protocol 2 ECDSA), or ~/.ssh/id_rsa (protocol 2
     RSA) and stores the public key in ~/.ssh/identity.pub (protocol 1),
     ~/.ssh/id_dsa.pub (protocol 2 DSA), ~/.ssh/id_ecdsa.pub (protocol 2
     ECDSA), or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home direc‐
     tory.  The user should then copy the public key to ~/.ssh/authorized_keys
     in his/her home directory on the remote machine.  The authorized_keys
     file corresponds to the conventional ~/.rhosts file, and has one key per
     line, though the lines can be very long.  After this, the user can log in
     without giving the password.
...
(known_hosts)
ssh automatically maintains and checks a database containing identifica‐
     tion for all hosts it has ever been used with.  Host keys are stored in
     ~/.ssh/known_hosts in the user's home directory.  Additionally, the file
     /etc/ssh/ssh_known_hosts is automatically checked for known hosts.  Any
     new hosts are automatically added to the user's file.  If a host's iden‐
     tification ever changes, ssh warns about this and disables password
     authentication to prevent server spoofing or man-in-the-middle attacks,
     which could otherwise be used to circumvent the encryption.  The
     StrictHostKeyChecking option can be used to control logins to machines
     whose host key is not known or has changed.
 
Old 11-12-2014, 02:09 PM   #3
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
i forgot to add: in own words
 
Old 11-12-2014, 02:42 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Not sure what you are looking for. Those are the 'official' purposes of those files. I'm unsure if any explanation using different words will be any clearer.
 
Old 11-12-2014, 03:33 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Is it possible this is a homework assignment?
 
Old 11-12-2014, 11:52 PM   #6
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
If the man pages don't make sense to you, Google could find you some tutorials and examples. That's how I set up ssh the first time.
 
Old 11-13-2014, 07:57 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by postcd View Post
i forgot to add: in own words
Nobody else can write in your own words.
 
Old 11-14-2014, 06:00 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by postcd View Post
i forgot to add: in own words
Ok... in my own words.....

authorized_keys - Vurble bleargh splinketage ipsum lorem

(etc. etc.)

Go do your homework yourself.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Explain the contents of hal.conf pwabrahams Linux - Software 2 09-08-2008 12:10 PM
list contents of directory without listing contents baddah Linux - Newbie 2 06-12-2006 04:02 AM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Can someone explain the basics of private-key authentication through SSH? lowpro2k3 Linux - Security 2 06-08-2005 11:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration