• jopiek
  • Registratie: September 2000
  • Laatst online: 11-01 16:46

jopiek

Tja... 'ns ff denken.

Topicstarter
Ik heb mijn server maar eens een upgrade gegeven, FreeBSD 6.x naar 7.1, nieuwe schijf, meer geheugen, etc. Maar nu is alleen het vervelende dat ik het meest basale proces niet aan de gang krijg: ssh.

Ik heb zowel via pam als zonder pam geprobeerd om in te loggen.
Ik probeer in te loggen met een user die wel in wheel zit maar dus niet root is ivm security. Op de bak zelf kan ik keurig er mee inloggen en ook su en naar root.

/var/log/messages geeft: sshd[nummer]: error: PAM: authentication error for username from 192.168.2.102
als PAM uitstaat krijg ik gewoon in terminal dat ik niet kan inloggen met dat wachtwoord.

ik heb flink zitten prutsen in /etc/ssh/sshd_config maar tot op heden geen resultaat.
herstarten van pam doe ik met /etc/rc.d/sshd restart

ik denk dat het aan 7.1 ligt want ik zie wat berichtjes in google die daar op wijzen zoals deze:
link

Cogito Ergo Credo


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

laat ons je sshd_config eens zien :).
Al geprobeerd met een schone user?

En ook je pam configs.

[ Voor 15% gewijzigd door Boudewijn op 08-02-2009 21:57 ]


  • jopiek
  • Registratie: September 2000
  • Laatst online: 11-01 16:46

jopiek

Tja... 'ns ff denken.

Topicstarter
Boudewijn schreef op zondag 08 februari 2009 @ 21:57:
laat ons je sshd_config eens zien :).
Al geprobeerd met een schone user?

En ook je pam configs.
Lastig er heen te krijgen zo, maar ik knip/plak even vanaf de link.

code:
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
123
124
125
126
127
128
#       $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
#       $FreeBSD: src/crypto/openssh/sshd_config,v 1.47.2.1 2008/09/01 20:03:13 des Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

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

# 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 change a
# default value.

# Note that some of FreeBSD's defaults differ from OpenBSD's, and
# FreeBSD has a few additional options.

VersionAddendum FreeBSD-20080901

Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 1h
ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
LogLevel INFO

# Authentication:

LoginGraceTime 60m
PermitRootLogin no
StrictModes yes
MaxAuthTries 6
MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys

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

# Change to yes to enable built-in password authentication.
PasswordAuthentication no
PermitEmptyPasswords no

# Change to no to disable PAM authentication
# ChallengeResponseAuthentication yes
ChallengeResponseAuthentication yes

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication 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 ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
PrintMotd yes
PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

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

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

AllowUsers username

Cogito Ergo Credo


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

Ja, je hebt alleen 1 user die je allowt 'username', was dat je bedoeling?

Verder:
code:
1
2
3
# Change to no to disable PAM authentication
# ChallengeResponseAuthentication yes
ChallengeResponseAuthentication yes


Daar al meegespeeld? idem voor UsePAM.

  • jopiek
  • Registratie: September 2000
  • Laatst online: 11-01 16:46

jopiek

Tja... 'ns ff denken.

Topicstarter
Boudewijn schreef op zondag 08 februari 2009 @ 22:08:
Ja, je hebt alleen 1 user die je allowt 'username', was dat je bedoeling?

Verder:
code:
1
2
3
# Change to no to disable PAM authentication
# ChallengeResponseAuthentication yes
ChallengeResponseAuthentication yes


Daar al meegespeeld? idem voor UsePAM.
yups, alleen die user mag via de ssh client connecten. Ik heb daar idd al even mee gespeeld, maar dan krijg ik dus ook problemen. Ik heb alleen wel door dat als ik dan PAM wil gebruiken ik nog wel een en ander moet doen om dat aan de praat te krijgen en dat snapt "Building a server with FreeBSD 7" niet geloof ik. Nou ja, eerst mysql maar eens er op zetten (die installeer ik dan met PAM), maar was altijd gewend dat vanuit de terminal te kunnen doen, dan heb je wat meer mogelijkheden en zo.

Cogito Ergo Credo


  • jopiek
  • Registratie: September 2000
  • Laatst online: 11-01 16:46

jopiek

Tja... 'ns ff denken.

Topicstarter
Ik heb even met PAM gerommeld, begin dat nu beetje door te krijgen. Blijkbaar was andere user ook niet optimaal, maar ik heb nu even 'debug' user janmdpet gemaakt:

ssh -l janmdpet 192.168.2.100
pam_login_access: pam_sm_acct_mgmt: janmdpet is not allowed to log in from 192.168.2.102

Inmiddels heb ik AllowUsers even uitgezet.

[update:]

Problem solved (vooralsnog), regels in login.access waren de boosdoener, die heb ik nu even uitgezet, maar zal voor veiligheid wel weer even aangepast moeten, maar dan less restrictive.

[ Voor 23% gewijzigd door jopiek op 11-02-2009 10:53 ]

Cogito Ergo Credo

Pagina: 1