Windows使用SSH管理Ubuntu

歡迎訪問我的新博客:http://www.milkcu.com/blog/

原文地址:http://www.milkcu.com/blog/archives/manage-ubuntu-on-windows-using-ssh.html

原創:Windows使用SSH管理Ubuntu

作者:MilkCu

摘要:SSH是轉爲遠程登錄會話和其他網絡服務提供安全性的協議,SSH包含客戶端和服務器兩部分,本文主要講解了如何在Windows下配置和使用SSH協議管理Ubuntu。

SSH協議介紹

SSH是Secure Shell的縮寫,是一項創建在應用層和傳輸層基礎上的的安全協議,爲計算機的shell提供安全的傳輸和使用環境。SSH是專爲遠程登錄會話和其他網絡服務提供安全性的協議,另一優點是其傳輸的數據可以經過壓縮加快傳輸速度。

最初的SSH受版權和加密算法等的限制,現在很多人都轉而使用開源免費的OpenSSH。

Ubuntu搭建SSH服務器

SSH分爲opeenssh-client和openssh-server。

Ubuntu默認已經安裝openssh-client,可以用來登陸別的機器。

如果本機想開放SSH服務,就要安裝openssh-server,當然openssh-client可能因爲版本問題而重新安裝。

下面把我在Ubunt 12.04下安裝openssh-server的過程記錄一下。

(1)嘗試安裝openssh-server軟件包:

sudo apt-get install openssh-server

但是有兩個錯誤提示需要解決

(2)安裝指定版本的openssh-client

錯誤提示如下所示:

The following packages have unmet dependencies:
 openssh-server : Depends: openssh-client (= 1:5.9p1-5ubuntu1) but 1:5.9p1-5ubuntu1.1 is to be installed

這條錯誤的意思是,要安裝的openssh-server的依賴軟件包openssh-client版本不滿足要求。

解決方案就是先安裝指定版本的openssh-client。

sudo apt-get install openssh-client=1:5.9p1-5ubuntu1.1

(3)安裝ssh-import-id

還有一條提示如下所示,意思就是這個軟件沒安裝。

Recommends: ssh-import-id but it is not going to be installed

我們可以通過下面的命令安裝:

sudo apt-get install ssh-import-id

(4)測試是否安裝成功

ps -e | grep ssh

如果看到sshd說明openssh-server已經啓動。

(5)服務配置

ssh-server配置文件位於/etc/ssh/sshd_config,在這裏可以定義SSH的服務端口,默認端口是22

停止服務

sudo /etc/init.d/ssh stop

啓動服務

sudo /etc/init.d/ssh start

Windows安裝SSH客戶端

我們可以通過SSH客戶端在Windows上管理Linux,下面推薦兩款SSH客戶端,點擊或通過下面的超鏈接下載。

putty開源免費小巧的客戶端

http://milkcu.qiniudn.com/file/putty-0.63-installer.exe

Xshell面向學校和家庭免費

http://milkcu.qiniudn.com/file/Xshell4.exe

參考

[1] ubuntu開啓SSH服務 - nodot - 博客園, http://www.cnblogs.com/nodot/archive/2011/06/10/2077595.html

[2] Secure Shell - 維基百科,自由的百科全書, http://zh.wikipedia.org/wiki/Secure_Shell

(全文完)

本文地址:http://www.milkcu.com/blog/archives/manage-ubuntu-on-windows-using-ssh.html

發佈了98 篇原創文章 · 獲贊 12 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章