<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IPCPU——网络之路 &#187; IOS</title>
	<atom:link href="http://www.ipcpu.com/tag/ios/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipcpu.com</link>
	<description></description>
	<lastBuildDate>Sat, 03 Dec 2011 17:16:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>CiscoIOS的用户管理</title>
		<link>http://www.ipcpu.com/2011/07/cisco-ios-user/</link>
		<comments>http://www.ipcpu.com/2011/07/cisco-ios-user/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 16:17:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[用户]]></category>
		<category><![CDATA[管理]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=1219</guid>
		<description><![CDATA[作为网络安全的一个重要方面，路由器的用户管理直接保障路由器的安全，起着至关重要的作用。 用户要对路由器进行管理访问，只有通过控制台console、aux或者网络进行访问，而网络的访问又分为telnet和ssh。对于aux大多数人已经不再关心，我们也不必考虑。 我们先看console控制台的配置 1 2 3 4 5 6 7 line con 0 exec-timeout 5 30 password ipcpu login 超时间设置可以防止未注销的连接被他人利用 设置密码起到一定的防护作用 login启用密码检查。 上面我们用到了密码认证的方式， 其实Cisco IOS用户的认证方式有3种： 》密码 》用户名+密码 》AAA 接下来的telnet方式我们使用第二种 telnet登陆方式 1 2 3 4 5 6 7 8 ! username ipcpu privilege 15 password 0 ipcpu ! line aux 0 line vty 0 4 password [...]]]></description>
			<content:encoded><![CDATA[<p>作为网络安全的一个重要方面，路由器的用户管理直接保障路由器的安全，起着至关重要的作用。</p>
<p>用户要对路由器进行管理访问，只有通过控制台console、aux或者网络进行访问，而网络的访问又分为telnet和ssh。对于aux大多数人已经不再关心，我们也不必考虑。</p>
<p>我们先看<strong>console控制台的配置</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">line con <span style="color: #cc66cc;">0</span>
exec<span style="color: #339933;">-</span>timeout <span style="color: #cc66cc;">5</span> <span style="color: #cc66cc;">30</span>
password ipcpu
login
超时间设置可以防止未注销的连接被他人利用
设置密码起到一定的防护作用
login启用密码检查。</pre></td></tr></table></div>

<p>上面我们用到了密码认证的方式，<br />
其实Cisco IOS用户的认证方式有3种：</p>
<p>》密码<br />
》用户名+密码<br />
》AAA</p>
<p>接下来的telnet方式我们使用第二种</p>
<p><strong>telnet登陆方式</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">!</span>
username ipcpu privilege <span style="color: #cc66cc;">15</span> password <span style="color: #cc66cc;">0</span> ipcpu
<span style="color: #339933;">!</span>
line aux <span style="color: #cc66cc;">0</span>
line vty <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">4</span>
password haha
login local
<span style="color: #339933;">!</span></pre></td></tr></table></div>

<p>这里虽然设置了password haha但是由于认证使用的login local使用本地库认证，所以password haha就没有什么实际意义了。</p>
<p>通过telnet登陆测试<br />
C:\&gt;telnet 192.168.66.254</p>
<p>User Access Verification</p>
<p>Username: ipcpu<br />
Password:<br />
Router#<br />
由于我们给ipcpu用户设定的等级是15级，所以ipcpu用户登陆进去就有最高权限。<span id="more-1219"></span></p>
<p><span style="color: #ff00ff;"><strong>注意：</strong></span>如果没有设置enable密码，telent用户级别是1，则该用户无法进入level 15级。</p>
<p><strong>ssh登陆方式</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">hostname core
ip domain<span style="color: #339933;">-</span>name ipcpu<span style="color: #339933;">.</span>com
&nbsp;
crypto <span style="color: #990000;">key</span> generate rsa general<span style="color: #339933;">-</span>keys
生成密钥时需要主机名和域名
&nbsp;
access<span style="color: #339933;">-</span><span style="color: #990000;">list</span> <span style="color: #cc66cc;">90</span> permit 4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>2
&nbsp;
username ipcpu password <span style="color: #cc66cc;">0</span> ipcpu
line vty <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">4</span>
login local
transport input ssh
此时在vty线路上只支持ssh登陆方式。
access<span style="color: #339933;">-</span><span style="color: #000000; font-weight: bold;">class</span> <span style="color: #cc66cc;">90</span> in
只有ACL90能访问</pre></td></tr></table></div>

<p>测试：<br />
在另外一台机器上登陆</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #666666; font-style: italic;">#ssh -l ipcpu 4.4.4.1
</span>
Password<span style="color: #339933;">:</span>
&nbsp;
core<span style="color: #339933;">&gt;</span>
core<span style="color: #339933;">&gt;</span>
core<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><strong>SSH高级设定</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">我们可以通过修改ssh选项，增强安全性和便利性。常用选项有：
Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#ip ssh ?
</span>authentication<span style="color: #339933;">-</span>retries  Specify number of authentication retries
<span style="color: #666666; font-style: italic;">##密码重试次数
</span>break<span style="color: #339933;">-</span>string            break<span style="color: #339933;">-</span>string
<span style="color: #666666; font-style: italic;">##终端提示
</span>logging                 Configure logging <span style="color: #b1b100;">for</span> SSH
<span style="color: #666666; font-style: italic;">##设置日志选项
</span>maxstartups             Maximum concurrent sessions allowed
<span style="color: #666666; font-style: italic;">##设置最大并发SSH连接
</span>port                    Starting <span style="color: #009900;">&#40;</span>or only<span style="color: #009900;">&#41;</span> Port number to listen on
<span style="color: #666666; font-style: italic;">##修改SSH端口
</span>rsa                     Configure RSA keypair name <span style="color: #b1b100;">for</span> SSH
<span style="color: #666666; font-style: italic;">##指定ssh使用的密钥对
</span>source<span style="color: #339933;">-</span><span style="color: #000000; font-weight: bold;">interface</span>        Specify <span style="color: #000000; font-weight: bold;">interface</span> <span style="color: #b1b100;">for</span> source address in SSH connections
<span style="color: #666666; font-style: italic;">##指定SSH监听IP
</span>time<span style="color: #339933;">-</span>out                Specify SSH time<span style="color: #339933;">-</span>out interval
<span style="color: #666666; font-style: italic;">##设置超时
</span>version                 Specify protocol version to be supported
<span style="color: #666666; font-style: italic;">##设定ssh版本有v1，v2
</span>
Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#ip ssh</span></pre></td></tr></table></div>

<p>对用户授权时注意用户级别的设定。<br />
可以查看本站文章<a title="Cisco IOS权限等级" href="http://www.ipcpu.com/2009/12/privilege-level-on-ios/" target="_blank"><span style="color: #0000ff;">Cisco IOS权限等级</span></a></p>
<p>在设置ssh时对于aaa的设定略有区别，大家可以查看<br />
<a href="http://xpvista.blog.51cto.com/420483/175410"><span style="color: #0000ff;">http://xpvista.blog.51cto.com/420483/175410</span></a><br />
区别是不启用aaa new-modle时需要设定hostname</p>
<p>后记：<br />
1.关于如何修改ssh默认端口的问题<br />
网上说的方法如下<br />
ip ssh port 2222 rotary 1<br />
line vty 0 4<br />
rotary 1<br />
这种方法实际上是打开2222端口，转发到vty线路，22号口、2222口同时存在。<br />
目前还没解决。<br />
下面帖子可以参考<br />
https://supportforums.cisco.com/thread/236110</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2011/07/cisco-ios-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS Login Enhancement特性简介</title>
		<link>http://www.ipcpu.com/2010/09/cisco-ios-login-block/</link>
		<comments>http://www.ipcpu.com/2010/09/cisco-ios-login-block/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 18:21:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[特性]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=1227</guid>
		<description><![CDATA[Cisco IOS Login Enhancement(Login Block)特性让用户可以增强路由器安全，防止恶意暴力破解等。 这个特性可以应用在telent或者ssh连接当中。 该特性在12.3(4)T中被引入，其他之前的版本仅有少数支持此特性。 该特性主要包括一下几个选项 core(config)#login ? block-for   Set quiet-mode active time period ##设置一定时间内输入密码错误次数，达到限制后阻止连接多长时间 delay       Set delay between successive fail login ##输入密码错误就会卡住x秒，x秒后才可以重新输入 on-failure  Set options for failed login attempt ##登陆失败就会发送信息给管理员 on-success  Set options for successful login attempt ##成功登陆就会发送信息给系统管理员 quiet-mode  Set quiet-mode options ##设定例外选项，不受login block限制 . 举个例子： 1 2 3 4 5 6 [...]]]></description>
			<content:encoded><![CDATA[<p>Cisco IOS Login Enhancement(Login Block)特性让用户可以增强路由器安全，防止恶意暴力破解等。</p>
<p>这个特性可以应用在telent或者ssh连接当中。</p>
<p>该特性在12.3(4)T中被引入，其他之前的版本仅有少数支持此特性。</p>
<p>该特性主要包括一下几个选项</p>
<p>core(config)#login ?<br />
<strong>block-for   Set quiet-mode active time period</strong><br />
##设置一定时间内输入密码错误次数，达到限制后阻止连接多长时间<br />
<strong>delay       Set delay between successive fail login</strong><br />
##输入密码错误就会卡住x秒，x秒后才可以重新输入<br />
<strong>on-failure  Set options for failed login attempt</strong><br />
##登陆失败就会发送信息给管理员<br />
<strong>on-success  Set options for successful login attempt</strong><br />
##成功登陆就会发送信息给系统管理员<br />
<strong>quiet-mode  Set quiet-mode options</strong><br />
##设定例外选项，不受login block限制</p>
<p>.</p>
<p><strong>举个例子：</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">ip ssh authentication<span style="color: #339933;">-</span>retries <span style="color: #cc66cc;">5</span>
login block<span style="color: #339933;">-</span><span style="color: #b1b100;">for</span> <span style="color: #cc66cc;">600</span> attempts <span style="color: #cc66cc;">3</span> within <span style="color: #cc66cc;">60</span>
<span style="color: #666666; font-style: italic;">##60秒内输入密码有3次错误，那么在600秒内Login就会被挂起，无法网管了
</span>login quiet<span style="color: #339933;">-</span>mode access<span style="color: #339933;">-</span><span style="color: #000000; font-weight: bold;">class</span> ex
<span style="color: #666666; font-style: italic;">##使用ACL控制不受限制的IP
</span>login on<span style="color: #339933;">-</span>failure trap
<span style="color: #666666; font-style: italic;">#登陆失败就会发送信息SNMP TRAP
</span>login on<span style="color: #339933;">-</span>success <span style="color: #990000;">log</span>
<span style="color: #666666; font-style: italic;">##成功登陆就会发送信息给syslog
</span><span style="color: #339933;">!</span>
ip access<span style="color: #339933;">-</span><span style="color: #990000;">list</span> standard ex
permit 4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>0 0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>255
<span style="color: #339933;">!</span></pre></td></tr></table></div>

<p><strong>测试：</strong><br />
我们另一台路由上<span id="more-1227"></span><br />
60s内输错3次，会被直接refused。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">r1<span style="color: #666666; font-style: italic;">#ssh -l ipcpu 4.4.4.1
</span>
Password<span style="color: #339933;">:</span>
&nbsp;
Password<span style="color: #339933;">:</span>
&nbsp;
Password<span style="color: #339933;">:</span>
&nbsp;
<span style="color: #339933;">%</span> Authentication failed<span style="color: #339933;">.</span>
&nbsp;
<span style="color: #009900;">&#91;</span>Connection to 4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>1 closed by foreign host<span style="color: #009900;">&#93;</span>
r1<span style="color: #666666; font-style: italic;">#
</span>r1<span style="color: #666666; font-style: italic;">#
</span>r1<span style="color: #666666; font-style: italic;">#ssh -l ipcpu 4.4.4.1
</span><span style="color: #339933;">%</span> Connection refused by remote host</pre></td></tr></table></div>

<p>设定了quiet-mode后不受限制：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">r1<span style="color: #666666; font-style: italic;">#ssh -l ipcpu 4.4.4.1
</span>
Password<span style="color: #339933;">:</span>
&nbsp;
Password<span style="color: #339933;">:</span>
&nbsp;
Password<span style="color: #339933;">:</span>
&nbsp;
<span style="color: #339933;">%</span> Authentication failed<span style="color: #339933;">.</span>
&nbsp;
<span style="color: #009900;">&#91;</span>Connection to 4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>1 closed by foreign host<span style="color: #009900;">&#93;</span>
r1<span style="color: #666666; font-style: italic;">#
</span>r1<span style="color: #666666; font-style: italic;">#
</span>r1<span style="color: #666666; font-style: italic;">#ssh -l ipcpu 4.4.4.1
</span>
Password<span style="color: #339933;">:</span>
&nbsp;
Password<span style="color: #339933;">:</span></pre></td></tr></table></div>

<p>我们可以通过查看login block的统计数据</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">core<span style="color: #666666; font-style: italic;">#sh login
</span>A <span style="color: #b1b100;">default</span> login delay of <span style="color: #cc66cc;">1</span> seconds is applied<span style="color: #339933;">.</span>
Quiet<span style="color: #339933;">-</span>Mode access <span style="color: #990000;">list</span> ex is applied<span style="color: #339933;">.</span>
All successful login is logged<span style="color: #339933;">.</span>
All failed login generate SNMP traps<span style="color: #339933;">.</span>
&nbsp;
Router enabled to watch <span style="color: #b1b100;">for</span> login Attacks<span style="color: #339933;">.</span>
<span style="color: #b1b100;">If</span> more than <span style="color: #cc66cc;">3</span> login failures occur in <span style="color: #cc66cc;">60</span> seconds or less<span style="color: #339933;">,</span>
logins will be disabled <span style="color: #b1b100;">for</span> <span style="color: #cc66cc;">600</span> seconds<span style="color: #339933;">.</span>
&nbsp;
Router presently in Normal<span style="color: #339933;">-</span>Mode<span style="color: #339933;">.</span>
<span style="color: #990000;">Current</span> Watch Window
<span style="color: #990000;">Time</span> remaining<span style="color: #339933;">:</span> <span style="color: #cc66cc;">30</span> seconds<span style="color: #339933;">.</span>
Login failures <span style="color: #b1b100;">for</span> <span style="color: #990000;">current</span> window<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">.</span>
Total login failures<span style="color: #339933;">:</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/09/cisco-ios-login-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS基于角色的CLI视图</title>
		<link>http://www.ipcpu.com/2010/05/role-based-cli/</link>
		<comments>http://www.ipcpu.com/2010/05/role-based-cli/#comments</comments>
		<pubDate>Fri, 07 May 2010 10:00:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[视图]]></category>
		<category><![CDATA[角色]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=501</guid>
		<description><![CDATA[Role-Based CLI Access Packet Tracer 5.3可以做，较旧的IOS版本做不了。 要使用基于角色的CLI视图,需满足： 1。启用AAA 2。设置enable密码（pass、secret均可） 使用方法 进入管理模式 Router#enable view root Password: Router#%PARSER-6-VIEW_SWITCH: successfully set to view &#8216;root&#8217;. Router#conf  t Enter configuration commands, one per line.  End with CNTL/Z. Router(config)#parser view test !创建新视图test Router(config-view)#%PARSER-6-VIEW_CREATED: view &#8216;test&#8217; successfully created. Router(config-view)#secret 0 ipcpu Router(config-view)#? View commands:   commands  Configure commands for a view //设置可以执行的命令 [...]]]></description>
			<content:encoded><![CDATA[<p>Role-Based CLI Access</p>
<p>Packet Tracer 5.3可以做，较旧的IOS版本做不了。</p>
<p>要使用基于角色的CLI视图,需满足：</p>
<p>1。启用AAA<br />
2。设置enable密码（pass、secret均可）</p>
<p><strong>使用方法</strong></p>
<p>进入管理模式<br />
<span style="color: #008000;">Router#enable view root<br />
Password:<br />
Router#%PARSER-6-VIEW_SWITCH: successfully set to view &#8216;root&#8217;.</span></p>
<p><span style="color: #008000;">Router#conf  t<br />
Enter configuration commands, one per line.  End with CNTL/Z.<br />
Router(config)#parser view test<br />
!创建新视图test<br />
Router(config-view)#%PARSER-6-VIEW_CREATED: view &#8216;test&#8217; successfully created.</span></p>
<p><span style="color: #008000;">Router(config-view)#secret 0 ipcpu<br />
Router(config-view)#?<br />
View commands:<br />
  commands  Configure commands for a view //设置可以执行的命令<br />
  default   Set a command to its defaults<br />
  exit      Exit from view configuration mode<br />
  no        Negate a command or set its defaults<br />
  secret    Set a secret for the current view<br />
Router(config-view)#<span id="more-501"></span></span></p>
<p><strong>测试</strong>，默认没有几个命令<br />
Router#enable view test<br />
Password:<br />
Router#%PARSER-6-VIEW_SWITCH: successfully set to view &#8216;test&#8217;.</p>
<p>Router#?<br />
Exec commands:<br />
  disable     Turn off privileged commands<br />
  enable      Turn on privileged commands<br />
  exit        Exit from the EXEC<br />
  logout      Exit from the EXEC<br />
Router#</p>
<p>官网有几个角色命令的例子，相关命令等级的划分可参考官网</p>
<p>官网链接：<br />
<a href="http://www.cisco.com/en/US/products/sw/secursw/ps5318/products_configuration_example09186a0080993ff0.shtml" target="_blank">Cisco IOS Role-Based Access Control with SDM</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2010/05/role-based-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS权限等级</title>
		<link>http://www.ipcpu.com/2009/12/privilege-level-on-ios/</link>
		<comments>http://www.ipcpu.com/2009/12/privilege-level-on-ios/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 02:37:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[用户]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=327</guid>
		<description><![CDATA[Cisco IOS的权限等级有三个level0、level1、level15 其中level0有5条命令，level1有大概40条命令,其余的都在level15中。 高等级可以调用低等级的命令。 用户EXEC模式-权限等级1   特权EXEC模式-权限等级15 我们先看level0的命令： 1 2 3 4 5 6 7 8 9 10 11 Router#enable 0 Router&#62;? Exec commands: disable Turn off privileged commands enable Turn on privileged commands exit Exit from the EXEC help Description of the interactive help system logout Exit from the EXEC Router&#62;enable 1 % No password [...]]]></description>
			<content:encoded><![CDATA[<p>Cisco IOS的权限等级有三个level0、level1、level15<br />
其中level0有5条命令，level1有大概40条命令,其余的都在level15中。<br />
高等级可以调用低等级的命令。</p>
<p>用户EXEC模式-权限等级1   特权EXEC模式-权限等级15</p>
<p>我们先看level0的命令：<br />
<span style="color: #339966;"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #666666; font-style: italic;">#enable 0
</span>Router<span style="color: #339933;">&gt;</span>?
<span style="color: #990000;">Exec</span> commands<span style="color: #339933;">:</span>
  disable  Turn off privileged commands
  enable   Turn on privileged commands
  <span style="color: #990000;">exit</span>     <span style="color: #990000;">Exit</span> from the <span style="color: #990000;">EXEC</span>
  help     Description of the interactive help <span style="color: #990000;">system</span>
  logout   <span style="color: #990000;">Exit</span> from the <span style="color: #990000;">EXEC</span>
Router<span style="color: #339933;">&gt;</span>enable <span style="color: #cc66cc;">1</span>
<span style="color: #339933;">%</span> No password set
Router<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><span id="more-327"></span><br />
</span>从level0进入level1提示密码没有设置。<br />
给level1设置密码：<br />
<span style="color: #339966;"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#enable password level 1 0 ipcpu
</span><span style="color: #339933;">%</span> Converting to a secret<span style="color: #339933;">.</span>  Please <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #0000ff;">&quot;enable secret&quot;</span> in the future<span style="color: #339933;">.</span></pre></td></tr></table></div>

<p></span>!这里面的0表示明文显示，但是IOS自动把password转为secret。</p>
<p><span style="color: #339966;"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #666666; font-style: italic;">#enable 0
</span>Router<span style="color: #339933;">&gt;</span>en
Router<span style="color: #339933;">&gt;</span>enable <span style="color: #cc66cc;">1</span>
Password<span style="color: #339933;">:</span>
Router<span style="color: #339933;">&gt;</span>
命令如下：
Router<span style="color: #339933;">&gt;</span>?
<span style="color: #990000;">Exec</span> commands<span style="color: #339933;">:</span>
  access<span style="color: #339933;">-</span>enable    Create a temporary Access<span style="color: #339933;">-</span><span style="color: #990000;">List</span> entry
  access<span style="color: #339933;">-</span>profile   Apply user<span style="color: #339933;">-</span>profile to <span style="color: #000000; font-weight: bold;">interface</span>
  clear            <span style="color: #990000;">Reset</span> functions
  connect          Open a terminal connection
  disable          Turn off privileged commands
  disconnect       Disconnect an existing network connection
  enable           Turn on privileged commands
  <span style="color: #990000;">exit</span>             <span style="color: #990000;">Exit</span> from the <span style="color: #990000;">EXEC</span>
  help             Description of the interactive help <span style="color: #990000;">system</span>
  lock             Lock the terminal
  login            <span style="color: #990000;">Log</span> in <span style="color: #b1b100;">as</span> a particular user
  logout           <span style="color: #990000;">Exit</span> from the <span style="color: #990000;">EXEC</span>
  mrinfo           Request neighbor and version information from a multicast
                   router
  mstat            Show statistics after multiple multicast traceroutes
  mtrace           Trace reverse multicast path from destination to source
  name<span style="color: #339933;">-</span>connection  Name an existing network connection
  pad              Open a X<span style="color: #339933;">.</span>29 PAD connection
  ping             Send <span style="color: #b1b100;">echo</span> messages
  ppp              Start IETF Point<span style="color: #339933;">-</span>to<span style="color: #339933;">-</span>Point Protocol <span style="color: #009900;">&#40;</span>PPP<span style="color: #009900;">&#41;</span>
  resume           Resume an active network connection
  rlogin           Open an rlogin connection
  show             Show running <span style="color: #990000;">system</span> information
  slip             Start Serial<span style="color: #339933;">-</span>line IP <span style="color: #009900;">&#40;</span>SLIP<span style="color: #009900;">&#41;</span>
  systat           Display information about terminal lines
  telnet           Open a telnet connection
  terminal         Set terminal line parameters
  traceroute       Trace route to destination
  tunnel           Open a tunnel connection
  udptn            Open an udptn connection
  where            <span style="color: #990000;">List</span> active connections
  x28              Become an X<span style="color: #339933;">.</span>28 PAD
  x3               Set X<span style="color: #339933;">.</span>3 parameters on PAD
&nbsp;
Router<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><span style="color: #339966;"></span></p>
<p>其实level1级别就是从console登录到路由router&gt; 的最初级别</p>
<p>接下来我们设置几个用户，将15级的命令clear line放到1级：</p>
<p><span style="color: #339966;"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#username wss privilege 1 password wss
</span>登陆后
Router<span style="color: #339933;">&gt;</span>clear ?
<span style="color: #339933;">%</span> Unrecognized command
Router<span style="color: #339933;">&gt;</span>en
Password<span style="color: #339933;">:</span>
Router<span style="color: #666666; font-style: italic;">#conf t
</span>Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#privilege exec level 1 clear line
</span>再次用wss登陆
Router<span style="color: #339933;">&gt;</span>clear line ?
  <span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">&gt;</span>   Line number
  aux      Auxiliary line
  console  Primary terminal line
  tty      Terminal controller
  vty      <span style="color: #990000;">Virtual</span> terminal
&nbsp;
Router<span style="color: #339933;">&gt;</span>clear line</pre></td></tr></table></div>

<p><span style="color: #339966;"></span></p>
<p>IOS可以使用privilege命令将1或者15的命令抠出来，放到其中的几个级别。</p>
<p>我们平时使用的enable实际就是enable 15的简写<br />
<span style="color: #339966;"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Router<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">#enable secret level 15 0 ncist</span></pre></td></tr></table></div>

<p></span></p>
<p>再次登陆验证！<br />
H3C设备的命令级别分4个： 访问级0级、监控级1级、系统级2级、管理级3级。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2009/12/privilege-level-on-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

