日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux怎么重装ssh服务器,Linux平台下安装SSH

發布時間:2025/3/12 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux怎么重装ssh服务器,Linux平台下安装SSH 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

什么是SSH?Secure Shell(縮寫為SSH),由IETF的網絡工作小組(Network Working Group)所制定;SSH為一項創建在應用層和傳輸層基礎上的安全協議,為計算機上的Shell(殼層)提供安全的傳輸和使用環境。傳統的網絡服務程序,如rsh、FTP、POP和Telnet其本質上都是不安全的;因為它們在網絡上用明文傳送數據、用戶帳號和用戶口令,很容易受到中間人(man-in-the-middle)攻擊方式的攻擊。就是存在另一個人或者一臺機器冒充真正的服務器接收用戶傳給服務器的數據,然后再冒充用戶把數據傳給真正的服務器。而SSH是目前較可靠,專為遠程登錄會話和其他網絡服務提供安全性的協議。利用SSH協議可以有效防止遠程管理過程中的信息泄露問題。通過SSH可以對所有傳輸的數據進行加密,也能夠防止DNS欺騙和IP欺騙。SSH之另一項優點為其傳輸的數據可以是經過壓縮的,所以可以加快傳輸的速度。SSH有很多功能,它既可以代替Telnet,又可以為FTP、POP、甚至為PPP提供一個安全的“通道”。

下面以CentOS平臺為例,說明怎么安裝ssh服務器。下面為了方便,都是以root用戶權限去操作,實際情況下,請使用一般用戶權限去使用,只需要加入sudo就行。

[root@localhost ~]# yum install openssh-server

這樣就可以安裝好ssh-server了。

檢驗SSH是否安裝好了,可以用下面的命令:

[linuxidc@localhost ~]$ ssh -version

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010

Bad escape character 'rsion'.

如果顯示上面的信息,說明安裝好了SSH。

有些用戶可能會問,我怎么記地是安裝openssh-server而不是直接yum install ssh呢?這里告訴大家一個方法(CentOS平臺),可以快速知道我們需要安裝程序的名稱。如下:

[root@localhost ~]# yum search ssh

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* base: mirrors.btte.net

* extras: mirrors.btte.net

* updates: www.ftp.ne.jp

============================= N/S Matched: ssh =============================

ksshaskpass.x86_64 : A KDE version of ssh-askpass with KWallet support

libssh2.i686 : A library implementing the SSH2 protocol

libssh2.x86_64 : A library implementing the SSH2 protocol

libssh2-devel.i686 : Development files for libssh2

libssh2-devel.x86_64 : Development files for libssh2

libssh2-docs.x86_64 : Documentation for libssh2

openssh.x86_64:An open source implementation of SSH protocol versions 1and 2

openssh-askpass.x86_64 : A passphrase dialog for OpenSSH and X

openssh-clients.x86_64 : An open source SSH client applications

openssh-ldap.x86_64 : A LDAP support for open source SSH server daemon

openssh-server.x86_64 : An open source SSH server daemon

pam_ssh_agent_auth.i686 : PAM module for authentication with ssh-agent

pam_ssh_agent_auth.x86_64 : PAM module for authentication with ssh-agent

trilead-ssh2.noarch : SSH-2 protocol implementation in pure Java

trilead-ssh2-javadoc.noarch : Javadoc for trilead-ssh2

jsch.noarch : Pure Java implementation of SSH2

python-paramiko.noarch : A SSH2 protocol library for python

python-twisted-conch.x86_64 : SSH and SFTP protocol implementation

together with clients and servers

Name and summary matches only, use "search all" for everything.

從上面我們可以看到openssh-server,這就是我們需要安裝的程序名稱。

如果你是Ubuntu平臺呢?沒關系,可以運行下面的命令,也可以達到上面一樣的效果

[root@localhost ~]# apt-get update //這行可以不要

[root@localhost ~]# apt-cache search ssh

下面我們列出ssh服務sshd在各個執行等級的啟動情況:

[root@localhost ~]# chkconfig --list sshd

sshd? ? ? 0:off? ? 1:off? ? 2:off? ? 3:off? ? 4:off? ? 5:off? ? 6:off

手動啟動sshd服務(需要root權限),命令如下:

[root@localhost ~]# /etc/init.d/sshd start

Generating SSH1 RSA host key:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

Generating SSH2 RSA host key:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

Generating SSH2 DSA host key:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

Starting sshd:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

這樣可以在putty或別的客戶端登錄到這臺Linux機器了。如果需要停止ssh服務可以運行下面的命令

[root@localhost ~]# /etc/init.d/sshd stop

Stopping sshd:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

相關閱讀:

Ubuntu 12.04下安裝Git,SSH及出現的Permission denied解決辦法 http://www.linuxidc.com/Linux/2013-06/85336.htm

總結

以上是生活随笔為你收集整理的linux怎么重装ssh服务器,Linux平台下安装SSH的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。