歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> ssh2的安裝與配置

ssh2的安裝與配置

日期:2017/2/27 14:18:37   编辑:更多Linux
  ssh(secure shell client)是用來登錄遠程系統執行命令的一種程序。它可以取代rlogin和rsh並且可以在一個不安全的網絡環境中為服務器與客戶機提供安全的、加密的連接。為了服務器的安全,任何稱職的 管理員都應該使用ssh,下面就來介紹一下ssh的安裝和配置過程。 1 軟件獲取 http://210.74.166.205/pub/security/ssh/ssh-secure-shell-2.1.0-noncommercial.tar.gz 2 安裝 # tar zxvf ssh-2.0.13.tar.gz # cd ssh-2.0.13 # ./configure # make # make install 默認情況下,ssh將被安裝在/usr/local/下。 3 啟動服務器端 在提示符下運行: # /usr/local/sbin/sshd2 為了在系統重新啟動之後可以自動執行上述命令,還應該把上面的命令添加到/etc/rc.d/rc.local中去。之後可以在命令行中運行ps xgrep sshd命令,看看有沒有類似下面的輸出,如果有那麼恭喜你了: 213 ?? Is 0:00.46 /usr/local/sbin/sshd2 4 客戶端 在Linux/unix下,安裝好這個ssh就有了客戶端程序了。你可以選擇是用系統的passWord還是用ssh2的passphrase,如果選擇使用ssh的passphrase的話,需要運行下面的命令: # ssh-keygen2 Generating 1024-bit dsa key pair 6 Oo.oOo.oOoo. Key generated. 1024-bit dsa, [email protected], Thu Jun 22 2000 14:33:39 +0800 Passphrase : Again : Private key saved to /root/.ssh2/id_dsa_1024_a Public key saved to /root/.ssh2/id_dsa_1024_a.pub 之後 # cd ~/.ssh2 按照下面的格式創建兩個文件: # vi identification 加入: IdKey id_dsa_1024_a 在服務器的相應用戶的~/.ssh2目錄中 # vi authorization 加入: Key id_dsa_1024_a.pub 然後在客戶端運行: # ssh youdomain.com Host key not found from database. Are you sure you want to continue connecting (yes/no)? yes Host key saved to /home/chenlf/.ssh2/hostkeys/key_22_210.74.166.253.pub host key for 210.74.166.253, accepted by chenlf Thu Jun 22 2000 14:54:01 +0800 Passphrase for key "/home/chenlf/.ssh2/chenlf" with comment "1024-bit dsa,[email protected], Wed May 17 2000 15:13:17+0800": 在“:”後輸入你的passphrase就可以了! Windows下可以使用Secure CRT 3.0。




Copyright © Linux教程網 All Rights Reserved