學習Linux兩個月有餘,現寫上一篇我的對SecureCRT遠程登陸Linux系統的看法!
linux
首先簡單介紹一下SecureCRT:編程
SecureCRT是一款支持SSH(SSH1和SSH2)的終端仿真程序,簡單地說是Windows下登陸UNIX或Linux服務器主機的軟件。vim
密鑰登陸:服務器
1.使用SecureCRT建立私鑰和公鑰.session
SecureCRT: Quick Connect -> Authentiation -> Public Key -> Properties -> Create Identity File -> DSA/RSA -> Set Passphrase -> Donessh
這個時候在指定目錄會生成兩個文件,例如,私鑰my_rsa和公鑰my_rsa.pubide
2.linux服務器上創建.ssh目錄,通常狀況下,已經有這個目錄學習
# mkdir /root/.sshui
# chmod 700 /root/.sshspa
3.將公鑰 my_rsa.pub 傳到linux服務器,將SSH2兼容格式的公鑰轉換成爲Openssh兼容格式
# ssh-keygen -i -f Identity.pub >> /root/.ssh/authorized_keys2
# chmod 600 /root/.ssh/authorized_keys2
4.在SecureCRT裏面設置登陸模式爲PublicKey,並選擇剛剛建立的my_rsa文件做爲私鑰
5.重啓Linux服務器上SSH服務器
#service sshd restart 或者 /etc/rc.d/init.d/sshd restart
6.因爲已經設置了密鑰登陸,原來的密碼登陸就徹底能夠去掉
# vi /etc/ssh/sshd_config
Protocol 2 /僅容許使用SSH2
PubkeyAuthentication yes /*啓用PublicKey認證
AuthorizedKeysFile .ssh/authorized_keys2 /*PublicKey文件路徑
PasswordAuthentication no /*禁止密碼驗證登陸
PS:以上步驟是使用SecureCRT生成的密鑰對來進行登陸驗證的,其實也能夠在服務器上使用ssh-keygen命令生成的密鑰,一樣在生成密鑰對以後,將格式轉換成SecureCRT 使用的SSH2格式
如何在SucureCRT顯示vim顏色問題;
解決方法:
1.確認安裝了vim-enhanced
rpm -qa | grep vim-enhanced
2.optins>session options
Terminal>emulation
xterm再勾選ASNI color,use color scheme
Apperence>current color scheme
選擇traditional
單擊OK
最後,disconnet而後從新鏈接登錄就能夠了
顯示效果以下:
vim編程程序效果以下