|
v版pre 1.45,装了openssh,以前老版本的openssh好像是默认密码登录的,现在要密匙,感觉没必要,又改回密码认证了
* V$ i& M2 v2 t& v7 i5 v: k: f& j
2 v4 |7 T- _1 ?: p- C配置文件sshd_config改了一下就可以了,但是遇到一个奇怪的问题,每次第一次连接,如果wifi没先激活就用winscp之类的ssh客户端连接,就会出现”不支持的验证方式“的错误,重启关机pre也没用,只有把resolv.conf的nameserver更新了才行,附上我的配置文件,不知道跟设置有关系吗
1 J& j* [4 r# N/ e& d+ J/ S1 e2 Z! J* b
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $0 i+ T4 h- _% K" \9 m4 Q/ {
4 K4 S1 B& b% P( J
# This is the sshd server system-wide configuration file. See* f! X; S6 `3 G( _
# sshd_config(5) for more information.
" i7 f8 _6 X M; k# r9 Z' ]; s1 a9 c" X% ^
# This sshd was compiled with PATH=/opt/sbin:/opt/bin:/usr/sbin:/usr/bin:/sbin:/bin( O9 c4 E5 m) \0 W& T" ?. d
# X" b0 n+ V O
# The strategy used for options in the default sshd_config shipped with; q( q, p6 e1 _9 e, w
# OpenSSH is to specify options with their default value where
- F. H K2 p/ T1 p5 K8 E, M# i# possible, but leave them commented. Uncommented options change a
7 D* ?# }! N7 I0 Q- H& S. v# default value.
. Z$ q' C8 @ L' O
# n0 N" R& r! t) q#Port 223 `2 B+ _ n- o0 x: l
#AddressFamily any
, r4 ]+ K" B( u1 h#ListenAddress 0.0.0.04 z" ~: i, [/ v( t! c
#ListenAddress ::
+ u3 F9 u0 [/ q# f1 S1 o
4 I9 { b7 u5 n# Disable legacy (protocol version 1) support in the server for new9 @3 @0 @+ X. [
# installations. In future the default will change to require explicit/ T5 O9 H i% x2 \( Z/ [
# activation of protocol 1
# S& ]1 F/ |3 Q+ I7 UProtocol 2. z0 ]# F" S; Q# s# Z
* i$ t$ _; b1 W; o* t7 V3 F
# HostKey for protocol version 1( g0 m, {+ b3 A7 O* A" Z! {0 O
#HostKey /opt/etc/openssh/ssh_host_key
& w1 T& q h" L6 W) x4 {1 X0 w# HostKeys for protocol version 2
9 r& x- O- w- |2 u: k4 c! z; _' f#HostKey /opt/etc/openssh/ssh_host_rsa_key3 t4 U5 e- f# M' t1 n2 H
#HostKey /opt/etc/openssh/ssh_host_dsa_key8 {* e }4 e. Q9 [0 @
, L5 Q/ _: Z" x0 T# Lifetime and size of ephemeral version 1 server key4 _5 Y8 z* W+ R. q' b
#KeyRegenerationInterval 1h3 {: p6 ^4 E- [% F# z6 e
#ServerKeyBits 1024
* R; C, s: N) l! A8 y& x9 W' B$ E' G/ F; G: X/ ]6 R# C5 s
# Logging% C1 P: y& P, w# v
# obsoletes QuietMode and FascistLogging6 H( `7 f; [1 W& f2 g
#SyslogFacility AUTH
9 C: J" h/ b. i# C) h @ b2 o#LogLevel INFO4 s% n4 P; w1 z& ^7 J
. J/ g& a; o! g3 M Z% a# Authentication:
! D; l; P( k1 q4 x/ ^1 i0 N" I: O" q3 [" S2 J
#LoginGraceTime 2m3 X6 b4 E( q6 [" l8 T
PermitRootLogin yes
1 T( T; R* `5 g- ^$ ?#StrictModes yes% [. b8 N& |( W8 M6 ~& E0 m
#MaxAuthTries 6
) R% b5 O* x {( b5 z, g( T! r#MaxSessions 10
% m3 j9 [% z& \2 [
' A. A* [4 u0 T+ B6 u7 y4 D/ HRSAAuthentication no; W/ z" r0 t7 i& h! l. ?6 Y
PubkeyAuthentication no6 B% }, G) K! a% I& i3 e
#AuthorizedKeysFile .ssh/authorized_keys
2 Y1 a7 h; v4 l" X2 R* l% |3 @3 u
" o( m5 E: z% q; f+ f, b# For this to work you will also need host keys in /opt/etc/openssh/ssh_known_hosts
7 ^" T) ^3 U$ I& R" g#RhostsRSAAuthentication no
; n w# f; u! P/ B3 F# similar for protocol version 2# O9 _& p$ E/ _& G) M) p1 t
#HostbasedAuthentication no
- V' c' X% G" y* Z( q O/ o# Change to yes if you don't trust ~/.ssh/known_hosts for+ \2 B; K9 n4 b$ x0 m% I
# RhostsRSAAuthentication and HostbasedAuthentication
+ c( ~* N. u7 s8 i#IgnoreUserKnownHosts no
- L* V0 H7 P I+ v4 h) a5 n2 u) `# Don't read the user's ~/.rhosts and ~/.shosts files
1 J5 p/ ]) k2 y1 U3 q3 }6 m& X( A#IgnoreRhosts yes
$ ^* C5 T _) c' e* |
% J7 ^+ a1 w, { f# To disable tunneled clear text passwords, change to no here!
& U% I1 d0 Q. Y/ D# DPasswordAuthentication yes" ]- x, @% ]9 y$ \+ A1 S
PermitEmptyPasswords yes
2 P0 b, g0 W2 L. ` S4 d2 z: v$ A2 W2 d0 b* y( b+ f, U
# Change to no to disable s/key passwords3 n% |; t2 m E7 B4 j# T
ChallengeResponseAuthentication yes
\% v' \4 l Q4 L. z3 d, I) ?5 Q: j& U
# Kerberos options
" v7 f+ R7 p8 n0 NKerberosAuthentication yes
n1 ?7 j. E1 A% s4 l& s9 Y. v+ B#KerberosOrLocalPasswd yes( @: Z% |4 G* K, C8 X. O1 {- V6 S/ t
#KerberosTicketCleanup yes. w( \9 r0 Z+ C) `4 g) {
#KerberosGetAFSToken no
" ]: C3 q. k4 W) ]2 x9 `* s2 Y5 {% F2 `* n) Q1 q9 \ M
# GSSAPI options
0 ]5 }8 u. a: u5 F8 P#GSSAPIAuthentication no2 V6 T! ~) o7 d# R) Y
#GSSAPICleanupCredentials yes1 D1 s/ z% h- q) X! ]' Z
- G K( J U* L$ {- n# Set this to 'yes' to enable PAM authentication, account processing,
$ z6 H( ?. _+ f p8 S# and session processing. If this is enabled, PAM authentication will 5 s5 O8 n# c9 K8 p
# be allowed through the ChallengeResponseAuthentication and; X \/ d) K8 o
# PasswordAuthentication. Depending on your PAM configuration,$ [) L, `1 z' c' Z& Z* P6 v- j! K
# PAM authentication via ChallengeResponseAuthentication may bypass8 s# G, n6 t1 a- ^ C1 O
# the setting of "PermitRootLogin without-password".
2 }+ W7 A4 ~+ n) E2 \% g# If you just want the PAM account and session checks to run without
+ |6 d5 {/ X1 B" I$ e: ^( M# PAM authentication, then enable this but set PasswordAuthentication! f# p8 P1 V" {5 J* E" E6 y1 C
# and ChallengeResponseAuthentication to 'no'.
( k; ~! k: C0 QUsePAM yes
: w; F/ }& p3 n; E1 k3 R! b: i
#AllowAgentForwarding yes
+ l% H3 j1 z! u. O; b w# }# h4 [% z) ?#AllowTcpForwarding yes7 Y4 k+ `# {/ C1 g. z
#GatewayPorts no6 G3 ]4 E" s D% [6 g
#X11Forwarding no F$ i) {. g& s* v: j5 X; w
#X11DisplayOffset 10 R* t# k8 K/ G" V& A
#X11UseLocalhost yes
8 R9 k7 _; S6 x& ~# ~#PrintMotd yes7 q5 r& A4 v: W' Q w6 J
#PrintLastLog yes# { \6 R* q8 P% u7 A
#TCPKeepAlive yes' i/ c e. ^4 ~
#UseLogin no2 H' |. u/ g. ^
#UsePrivilegeSeparation yes
. h5 z. s; F8 D8 N9 Q#PermitUserEnvironment no
, \& F5 q. |1 D! y" t! \; J#Compression delayed3 Q, _; D7 D3 Q0 g( w7 W: \* _
#ClientAliveInterval 0: t- q9 F/ F1 P# ~4 T% }* \# R
#ClientAliveCountMax 37 S7 x1 t: L8 ^
#UseDNS yes
- p* {) A" J$ v; M, j* }#PidFile /opt/var/run/sshd.pid( X" Y1 G" t v$ ~- ]8 i
#MaxStartups 10
`7 { l3 G$ L. v4 b' l* x#PermitTunnel no
% X( c5 }% N( r) ?5 H* X* N#ChrootDirectory none* H- N3 x5 b) P: C0 N& C
- o, ]+ W& y8 E2 @2 [- ]0 U# no default banner path
5 S3 g6 K) s" B5 G4 c4 D#Banner none
, h, P: j7 B/ v( e" k5 k5 J& x
; H7 ]2 x* R+ g+ E6 w& W! j# override default of no subsystems6 u5 D' Y X$ A* P+ C
Subsystem sftp /opt/libexec/sftp-server& `1 P' ~/ K9 G$ z8 s1 |8 p
- |( K) G. t- ?. P. s, y
# Example of overriding settings on a per-user basis
6 N; I8 ^5 Q- s4 a8 {) r#Match User anoncvs0 |! r8 C8 g3 n6 x
# X11Forwarding no
, o$ [' }+ h' |) b) D+ Q, N# AllowTcpForwarding no
' J6 l4 o% E, \8 L3 `8 X# ForceCommand cvs server |
|