/usr/etc/ssh oder /etc/ssh

Guten Abend,

ich habe gesehen, dass es für ssh zwei Orte gibt. Einmal /etc/ssh und einmal /usr/etc/ssh. Jedoch existiert das File moduli nur in einem der beiden Verzeichnis.

Welches Verzeichnis wird per Default denn benutzt ?
Ich gehe davon aus, dass wenn beispielsweise moduli nur in einem Verzeichnis existiert (/usr/etc/ssh/) dann wird dieses für das System genutzt ? Liege ich hier richtig ?

/etc/ enthält Host-spezifische System-Konfigurationen
/usr/ enthält User-spezifische Konfigurationen, Anwendungen, Werkzeuge…

Und wenn man sich sowas fragt, ist das erste was man tut die man Seiten lesen. Hier also

man ssh

Danach kann man immer noch fragen, aber wenigstens zeigen das man das erste Logische getan hat.

Das hatte ich explizit getan und nach /usr gesucht. Aber hier konnte ich keinen Hinweis finden.

Vielleicht verstehe ich es falsch und es ist ne extrem blöde Frage, aber wenn ich ein config Verzeichnis wie sshd_config.d habe, dann ist dies host-spezifisch, aber wie kann ein Server Konfig Verzeichnis user-spezifisch sein.

  1. Ich habe nach /etc gesucht und einiges gefunden.

  2. Das verstehe ich auch nicht ganz, aber die man Seite sagt:

-F configfile
Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config ) will be ignored. The default for the per-user configuration file is ~/.ssh/config. If set to “none,” no configuration files will be read.

und das ist logischer.

Witr haben aber nur deine Ausssage

ich habe gesehen, dass es für ssh zwei Orte gibt. Einmal /etc/ssh und einmal /usr/etc/ssh.

Wo du das gefunden hast ist unklar (wir lieben Tatsachen und glauben kaum Schlußfolgen ohne Beweise :wink: )
Und du hast wie du sagst auch /usr nicht in der man Seite gefunden. Also, das gibt es /etc/usr/ssh nicht, wenigstens nicht in openSUSE.

Entschuldige aber ich verstehe deine Aussage nicht. Das es die /etc/ssh gibt und ~/.ssh weis ich. Das sind ja auch die ssh Verzeichnisse in anderen Distributionen, aber eben nicht /usr/etc/ssh.

Und darüber finde ich nichts in der man page.

Ich habe nie gesagt das es /usr/etc/ssh gibt oder geben soll. Das has du gemacht. Warum weis ich nicht.

Es gibt sie nicht und daher ist auch nicht zu finden in man ssh.

Ok, in meinem System gibt es eine /usr/etc/ssh Verzeichnis. Ich war davon ausgegangen, dass dies per default existiert.

┌──(neumann@testhost)-[236]-[19.02.23-21:44:11]-[~/Downloads]
└─$ cd /etc/ssh               

┌──(neumann@testhost)-[237]-[19.02.23-21:44:19]-[/etc/ssh]
└─$ ls
ssh_config.d   ssh_host_dsa_key      ssh_host_ecdsa_key      ssh_host_ed25519_key      ssh_host_rsa_key
sshd_config.d  ssh_host_dsa_key.pub  ssh_host_ecdsa_key.pub  ssh_host_ed25519_key.pub  ssh_host_rsa_key.pub

┌──(neumann@testhost)-[238]-[19.02.23-21:44:23]-[/etc/ssh]
└─$ cd /usr/etc/ssh 

┌──(neumann@testhost)-[239]-[19.02.23-21:44:34]-[/usr/etc/ssh]
└─$ ls
moduli  ssh_config  ssh_config.d  sshd_config  sshd_config.d

Es gibt das Verzeichnis (inklusive Dateien drin) /usr/etc/ssh sehr wohl. Und wenn man die Datei /usr/etc/ssh/ssh_config öffnet findet man auch eine super Erklärung drin:


# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# To modify the system-wide ssh configuration, create a "*.conf" file under
# "/etc/ssh/ssh_config.d/" which will be automatically included below.
# Don't edit this configuration file itself if possible to avoid update
# problems.
Include /etc/ssh/ssh_config.d/*.conf
Include /usr/etc/ssh/ssh_config.d/*.conf
1 Like

Ok, das habe ich tatsächlich nicht gesehen und nicht nachgeschaut, vielen Dank dafür.
Dann ist dies ähnlich wie bei FreeBSD. Vielen Dank für den Hinweis.