LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2018, 11:22 AM   #1
ozsnake
LQ Newbie
 
Registered: Jun 2015
Location: Mauritius
Distribution: CentOS, MacOS, Ubuntu
Posts: 8

Rep: Reputation: Disabled
Confused about /etc/ssh and ~./ssh


Hi,

I know the “/etc/ssh” directory is for the ssh daemon and the “~/.ssh” directory is for a particular user.

Both directories contain private and public keys:

but what is the difference between those keys in both directories? I’m confused because the ones i use as a user, is in my home directory ~/.ssh, and what are the roles of the keys found in /etc/ssh ? for what purpose are they created for ?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2018-04-23 at 18.08.06.png
Views:	20
Size:	22.6 KB
ID:	27494  
 
Old 04-23-2018, 11:31 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729
The directory /etc/ssh/ contains shared, global files for the all the users on that machine regardless of whether for the SSH client or SSH server. The files in ~/.ssh/ are specific to a particular user, again both client and server files. But that is just the default location, you can move things around especially on the server with directives like AuthorizedKeysFile in sshd_config.

See the tail end of the manual pages for both the SSH client and SSH server for information about the files.

Code:
man ssh
man sshd
The keys you find there by default in /etc/ssh/ are only those the server uses to identify itself when you connect to it. If you have the right server, as determined by matching server keys, then authentication goes ahead with user keys or passwords.

You can put user keys there, too, or in a subdirectory so that users can still authenticate with keys despite having encrypted home directories. There you have more choice about whether the users can or can't update their own keys.
 
1 members found this post helpful.
  


Reply

Tags
openssh root, ssh keys, ssh sshd root



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused on ssh key pairs chickenjoy Linux - Newbie 2 04-22-2018 08:50 AM
little confused about the ssh concept unclesamcrazy Linux - Newbie 4 06-25-2013 02:38 AM
rdiff-backup and ssh - I'm a bit confused TheFourthDoctor Linux - Software 4 08-14-2007 02:24 PM
Confused: FTP, SSH, SFTP msymms Linux - Networking 13 06-12-2007 12:35 PM
frustrated and confused trying to vnc over ssh oldweasel Linux - Software 3 05-27-2004 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:59 PM.

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