ubuntuusers.de

SSH PasswordAuthentication no

Status: Ungelöst | Ubuntu-Version: Server 20.04 (Focal Fossa)
Antworten |

Senifor79

Anmeldungsdatum:
22. Februar 2012

Beiträge: 424

Hallo liebe Forengemeinde,

ich möchte gern Kerberosauthentication bei meinem SSH Server einrichten. Das an sich funktioniert auch, allerdings erhalte ich immer noch als Fallback Passwordauthentication, obwohl ich das auf no gestellt habe.

sowohl in der sshd_config, als auch in Dateien unter ssh_config.d.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Include /etc/ssh/sshd_config.d/*.conf

Port 22
#AddressFamily any
ListenAddress 192.168.12.5
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication no

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
KbdInteractiveAuthentication no

# Kerberos options
KerberosAuthentication yes
KerberosOrLocalPasswd no
KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
UsePAM no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem	sftp	/usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server
#ChallengeResponseAuthentication no

Hat jemand einen Hinweis für mich ?

LG Senifor

Senifor79

(Themenstarter)

Anmeldungsdatum:
22. Februar 2012

Beiträge: 424

Also ich hab jetzt Pubkey-Verfahren auf yes gestellt, jetzt erscheint zumindest die Passwortabfrage nicht mehr. Ich wusste nicht, dass das nur in Kombination geht.

encbladexp Team-Icon

Ehemaliger
Avatar von encbladexp

Anmeldungsdatum:
16. Februar 2007

Beiträge: 17521

Die Authentifizierung unter Linux ist komplex, neben den paar builtin Dingern von SSHd gibt es auch noch PAM Module welche Einfluss darauf haben. Kerberos ist bei SSH heute eine Nische die kaum noch jemand benutzt. Meist werden die SSH Keys Zentral verwaltet (Ansible/Puppet) oder Krücken wie sssd genommen.

pzYsTorM

Anmeldungsdatum:
9. Dezember 2016

Beiträge: 9

Ich hatte gerade selbiges Problem - und dann nach viel Suchen und Verzweifeln gelöst.

Bei mir war es eine include Datei, die sich noch versteckt hatte:

# cat /etc/ssh/sshd_config.d/50-cloud-init.conf
PasswordAuthentication yes
# rm /etc/ssh/sshd_config.d/50-cloud-init.conf
# systemctl restart ssh.service

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4450

Wohnort: Göttingen

Man kann sich ja übrigens mit -T bei sshd die aktuelle Konfiguration anzeigen lassen und könnte die dann durchgreppen:

sshd -T | grep -i pubkeyauthentication

So ist man dann auch sicher welche Werte tatsächlich gesetzt sind, ohne sich darauf verlassen zu müssen, dass man auch wirklich alle Konfig-Dateien, die es so gibt, durchgeschaut hat.

Antworten |