
本帖最后由 宅男女神 于 2016-7-4 01:42 编辑 # U# @" A/ @1 Y- B
* O' `! @1 Y2 e用户通过Telnet或SSH方式登录设备实现本地或远程维护时,可以根据用户使用需求以及对设备安全的考虑来配置VTY,除对VTY类型用户界面呼入呼出进行限制的ACL号、用户名和口令及用户界面的验证方式外其他参数设备均有缺省值,用户可以结合实际需求和安全性考虑选择配置。
3 p; J& a. z) W8 p' Q( i0 F 1、设置通过账号和密码登陆VTY界面 $ ~! p, w" b! u6 p0 _ D/ \
1.1、进入VTY用户界面视图
% `- a- R. E; z- P [Huawei]user-interface vty ?
* h1 l+ Z6 P! S- M) ^- u INTEGER<0-4,16-20> Thefirst user terminal interface to be configured * M2 r& f2 d6 I6 `1 N$ b0 t
% x6 }8 Z8 ~/ k' p/ T' N; y [Huawei]user-interface vty 0 4 u# @6 L: ]$ e' [, o
[Huawei-ui-vty0-4]
, q1 x. V( u0 Z' s2 { 3 L& Q5 Q" R( [) [
1.2、设置用户验证方式为AAA验证(即通过账号和密码登陆)6 C9 P3 @; v I: o' I
[Huawei-ui-vty0-4]authentication-mode ? 8 s% @+ x+ N5 v, \( F! }: t6 Y* [
aaa AAA authentication
# t9 b/ j6 V3 A) }6 p; U. M none Login without checking * L' O' s* \5 g8 @# {
password Authentication throughthe password of a user terminal interface - t+ Q5 O3 K4 I5 i1 C0 ]4 |' j4 r# Z$ B
8 T2 H5 V/ L% d3 F4 w [Huawei-ui-vty0-4]authentication-mode aaa + n# R b# O/ F! _" d2 X
! ^% S0 G- D r5 s5 d! E( B 1.3、设置登陆的账号和密码9 @+ V% e1 [2 @" g# q. J7 @
[Huawei-ui-vty0-4]q % J* n5 N" L) ?; X7 i1 n. n7 H$ r
[Huawei]aaa
4 N1 M8 e3 [6 u) P5 w! Q6 ` [Huawei-aaa]local-user ?
. N) W( k; X/ \# a" O STRING<1-64> User name, inform of 'user@domain'. Can use wildcard '*',
! k2 U) p7 j2 t% W while displaying andmodifying, such as *@isp,user@*,*@*.Can
6 ?" k9 \. Z( p) c1 v not include invalid character/ \ : * ? " < > | @ ' 0 D4 z! r+ b7 }/ C# e3 y
# ?3 i7 p: h. x; y
[Huawei-aaa]local-user 023 ?
! U1 ^. a8 w" Q- `$ E, R access-limit Set access limit ofuser(s) 0 }4 e6 I: K; b! \
ftp-directory Set user(s) FTPdirectory permitted
4 W: W. m8 C! j1 U1 t idle-timeout Set the timeoutperiod for terminal user(s)
( o! b7 p1 U( L3 t/ g4 @8 D password Set password ( k$ |0 s' U$ K6 ?9 Q
privilege Set admin user(s)level
1 f) A6 ^$ b! w5 w: P# D- O service-type Service types forauthorized user(s)
& k. ~0 K# W& x8 [5 \* u state Activate/Block theuser(s) ' A$ ^+ U9 C" Q7 H3 h
user-group User group
8 E7 M$ l1 _# e1 A! A4 y
# A( ~6 ~! g5 b) O [Huawei-aaa]local-user 023 password ?
$ F4 {9 y+ |, ^! U$ \5 q cipher User password with ciphertext ) x8 L: N+ `1 \' m- p4 H: K1 Q
/ l" A/ R- [* s+ I. q
[Huawei-aaa]local-user 023 passwordcipher www
/ s5 @; C; M" D* C! c+ O2 ^5 h
$ T5 I1 [* X3 G4 U 1.4、设置账号的使用类型为Telnet或SSH " O, q& U* B, B
[Huawei-aaa]local-user 023 service-type telnet : U. m5 H1 U1 t( ^- z Z' V$ h% M
或
3 D1 L. N1 e$ C. M [Huawei-aaa]local-user 023 service-type ssh 2 L; r. C5 |6 D' V
( x4 I& R# M; g% s+ |2 [0 @ 2、设置只通过密码登陆VTY
8 w* N3 V5 y% C4 C. ~ 2.1、置用户验证方式为密码验证" \9 p4 w7 ^1 z2 o3 X
[Huawei-ui-vty0-4]authentication-modepassword
9 F+ }7 U; t0 l% L: H8 K% @ 7 w/ t& I, D; _% Q' U; p& V
2.2、设置登陆密码$ [7 A8 {% G% D2 b
[Huawei-ui-vty0-4]set authentication passwordcipher ?
+ L$ i' ~% \1 o) s STRING<1-16>/<24> Plain text/cipher text password 8 e- h: f- X6 a: {
$ o- N& q& V) x1 Q/ [. |
[Huawei-ui-vty0-4]set authenticationpassword cipher www
$ v) b' s$ E$ H- ?) A Q 5 `6 |0 F4 m# I) T
3、设置直接登陆VTY(此模式不安全) ) }" }& h7 L: D
[Huawei-ui-vty0-4]authentication-mode none 9 |7 U: P/ C6 v2 ^- C; O: {1 v1 @
4 ]1 [" u# b! W; s, t' l7 I2 J" D 4、配置VTY用户界面的用户优先级
& H8 j% T& S" M G 缺省情况下,VTY用户界面对应的默认命令访问级别是0,实际工作如果对权限要求不是特别严格,一本设置为15级。2 s2 ? ?* D: o
[Huawei-ui-vty0-4]user privilege level ? 9 B/ G# R+ T! }0 a/ l! P% N% c0 M
INTEGER<0-15> Set apriority ; n U6 ~* w9 h; v, D1 F
4 V+ h' u' c2 I4 x. ^
[Huawei-ui-vty0-4]user privilege level 15 9 ], G: k0 B9 n; I# Y7 a( C
8 ^2 M. A1 ]$ w, M: y3 U& p W. r 5、启用VTY终端服务
1 q; A; S Q1 I# ^ [Huawei-ui-vty0-4]shell
8 ?' M9 X* F/ J* j + Q+ @! r1 G/ n6 Z& ?
6、设置用户超时断连时间
; _/ ?( _7 k' G2 m5 j' p/ } [Huawei-ui-vty0-4]idle-timeout ? . t3 T$ U, K! ?% p7 j9 m( ]
INTEGER<0-35791> Set thenumber of minutes before a terminal user times out(default: 10minutes)
3 r" {6 K# T1 R- I
) g4 u* @' a" L. n3 ^( H. x# F 7、设置终端屏幕每屏显示的行数
1 Y7 j' D- Z1 f+ B) U [Huawei-ui-vty0-4]screen-length ?
) U0 j! m. C+ a% H) v* \1 e INTEGER<0-512> Display thenumber of lines on a screen (the value 0 indicates none split screen, and thedefault value is 24)
2 `9 {' I V- b$ D: M) G' M
. }9 b; @; D5 [5 o& Q 8、设置终端屏幕显示的列数 ) u- \) x' D" z) R$ Y4 D/ |( i
[Huawei-ui-vty0-4]screen-width ? 4 s. t! C. G7 `7 }" x/ r
INTEGER<60-512> Screenwidth value, the default is 80
3 [( t2 b h' g! G5 W
! \% A# Q/ P i1 k 9、设置历史命令缓存条数 % a5 m8 j! |) m$ c; L. d2 y& d& v
[Huawei-ui-vty0-4]history-command ? ! ^- u# e9 I. s/ i- F4 ]+ }7 x9 h
max-size Set the size of themaximum history buffer, the default value is 10 ) G5 K T0 P4 R" U) c- w2 ^0 e
2 i4 f( `, a( k. E) z
[Huawei-ui-console0]history-commandmax-size ? 6 _7 `, e3 l0 K0 J
INTEGER<0-256> The size ofa history buffer
9 X$ C/ y6 q! G% p$ s / P$ i: h9 K. W
10、VTY用户界面支持的登陆协议
+ Q+ |" W2 a+ E8 p8 Z [Huawei-ui-vty0-4]protocol inbound ? 5 k( y4 N0 R) V8 N* W3 g( W
all All protocols
, u0 Y$ D# Q$ z. Z+ G+ |1 a' P ssh SSH protocol ' o, a% i' q7 ~" U' z1 M6 y2 y Z
telnet Telnet protocol * J9 ^ T$ D2 P( h# ~+ w! x
" _% B' ~$ G# F! G$ k0 j% q
, W: W. D l. F! S5 U# i8 n
11、配置VTY用户界面的最大个数
; @* W1 T7 z! L& Y/ \ VTY用户界面最大个数是指登录设备的Telnet用户和SSH用户的总和。
+ D) t$ @. n4 p( b! f( v# q: ? 当配置VTY用户界面最大个数为0时,任何用户(包括网管用户)都无法通过VTY登录到设备。' ]% J1 y) i; C4 _/ C
如果要配置的VTY类型用户界面的最大个数小于当前在线用户的数量,则系统提示配置失败。如果要配置的VTY类型用户界面的最大个数大于当前最多可以登录用户的数量,就必须为新增加的用户界面配置验证方式。
$ r+ z- V! b2 h; \4 u: L4 ~2 B [Huawei]user-interface maximum-vty ?
3 Q6 W8 n1 f' U8 p: n+ ?9 G* X' V INTEGER<0-15> The maximumnumber of VTY users, the default value is 5
5 H) r6 k- N$ }& L2 J4 M
w. T* e( g: e/ Y* _7 ]3 y 12、配置VTY用户界面的基于ACL的登录限制
0 S m' W) J) s& f [Huawei-ui-vty0-4]acl ? . N K+ A) l9 N, N; k; {
INTEGER<2000-3999> Applybasic or advanced ACL / V |5 B- r/ ^4 g$ |% W
ipv6 Filter IPv6addresses : ^' A: w. E2 U/ s
( S: L$ _; H% b* m, i. O- `
[Huawei-ui-vty0-4]acl 2000 ?
) g, @, ]3 ^0 w/ P8 _* d) Y inbound Filter login connectionsfrom the current user interface i3 W" j' K3 _
outbound Filter logoutconnections from the current user interface 7 U9 Z8 C7 @& k( i2 a% J
8 E) l6 o7 a/ e- j 13、查看VTY用户界面信息 - s/ g5 U+ g" n9 z/ O( ~
[Huawei]display user-interface vty 04 $ S' [0 `9 c4 P, n
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int ; T6 j2 U! w2 q K$ g5 H
38 VTY 4 - 15 - N -
7 A' S) @6 `& T! u + : Current UI is active. ! b/ {( _0 [* n' e/ a: r/ P
F : Current UI is active andwork in async mode.
) s- D" F/ v( W8 w Idx : Absolute index of UIs.
8 y6 I5 `) Y& e X Type : Type and relative index of UIs. 9 a. T' l4 W0 }) I+ D
Privi: The privilege of UIs. ' A& E0 N! a9 g& A" \- B% w
ActualPrivi: The actual privilege of user-interface. - z8 Q4 H* F0 ?5 R8 @% i3 w3 T7 u
Auth : The authentication mode of UIs.
# z- B) w* p( i/ }% w8 X0 H A: Authenticate use AAA.
) \) [9 O+ O2 c9 q N: Current UI need not authentication.
9 I4 u' D# [& Z0 e' Z m P: Authenticate use current UI's password. ) u8 z1 o5 v! X
Int : The physical location ofUIs. 6 ^/ ^/ f1 y% L( @" I0 o y
" {5 D$ X$ Q) T
14、查看VTY类型用户界面的最大个数 : E# a% N4 _) f* t# i; ]4 c& T
[Huawei]display user-interface maximum-vty ! U1 O$ H7 |& t+ N- U( c
, O1 | L, @0 r% _ Maximum of VTY user:15 |
|