天天看點

利用Powershell SSH-Session 工具管理 linux或網絡裝置

首先我們需要下載下傳這個工具

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620181HvlU.png" target="_blank"></a>

1 下載下傳的檔案内容,請注意針對你使用的powershell 版本下載下傳相應的的版本,有支援powershell2.0以及支援powershell3.0和4.0。

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182ZE8B.png" target="_blank"></a>

2檢測一下你的系統 powershell子產品放置的目錄

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182jTYX.png" target="_blank"></a>

3 是以将下載下傳的壓縮檔案解壓到這兩個目錄随意一個都可以:

C:\Users\lixs\Documents\WindowsPowerShell\Modules   

C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182ZIIE.png" target="_blank"></a>

檔案夾裡面的檔案清單,這個DLL檔案需要.net 3.5或以上版本支援。

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_14066201827FYV.png" target="_blank"></a>

4  下面就是介紹這個功能應該怎麼使用,我們首先導入這個子產品,當然你也可以将它直接寫入配置檔案以便啟用powershell的時候直接調用:

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182PN6r.png" target="_blank"></a>

我們要知道怎麼使用這個指令當然需要檢視一下幫助資訊:

5 我們先擷取一下這個功能帶入了那些cmdlets

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182nqiL.png" target="_blank"></a>

6 檢視一下某個指令的幫助資訊

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182T9s7.png" target="_blank"></a>

可以通過摘要資訊了解到此子產品可以建立SSH會話到遠端SSH相容的主機。如:linux 或Unlix計算機或網絡裝置。

下面就舉例說明一下怎麼管理某個linux主機:

1 找到一個linux伺服器,可以通過SecureCRT遠端到。

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620182RQK5.png" target="_blank"></a>

2 建立一個到這個linux主機的Session(會話):

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620183QYDX.png" target="_blank"></a>

3 檢視這個會話:

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_140662018348hS.png" target="_blank"></a>

4 看看我們建立完會話以後可以做哪些事呢?

檢視IP

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620183YIsY.png" target="_blank"></a>

檢視版本資訊:

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620183Rs7i.png" target="_blank"></a>

登入這個會話調試資訊:

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_14066201837dyz.png" target="_blank"></a>

5  删除會話:

<a href="http://lixiaosong.blog.51cto.com/attachment/201407/29/705126_1406620187UZXO.png" target="_blank"></a>

當然也可以管理網絡裝置,接下來會有相關的介紹,大家也可以嘗試一下!

功能還是很強大啊哈哈!

本文轉自handsome7038 51CTO部落格,原文連結:http://blog.51cto.com/lixiaosong/1532280

繼續閱讀