在實際環境中,不少場景須要遠程登陸Centos,經過一款終端軟件(Xshell,CRT,超級終端等),既能方便咱們遠程,又能有一個敲命令的好界面。html
vmware新建Linux虛擬機:Linux系統安裝01-centos7系統安裝shell
Centos7.6的安裝,分區,基本配置:Linux系統安裝02-centos7系統安裝-分區及基本設置vim
Centos7.6的網絡配置:Linux系統優化-centos7網卡配置centos
系統鏡像-centos7.6-X64-1810網絡
平臺-虛擬機-VMwareworkstation15(PRO)ssh
安裝vmware的主機-WIN2012R2數據中心版post
下載終端軟件,如Xshell,安裝在本機上;在Centos上開啓SSH服務,就能愉快的遠程。優化
Xshell的下載地址:https://www.xshellcn.com/xiazai.htmlurl
Xshell的安裝:https://www.xshellcn.com/xsh_column/setup-xshell.htmlcentos7
1.下載Xshell並安裝:見上連接
2.Centos開啓SSH遠程:
# 配置ssh跟sftp #
- ssh
- 檢測是否安裝openssh
- `yum list installed | grep openssh-server`
- `rpm -qa|grep ssh`
- 安裝openssh
- yum install openssh-server
- rpm -ivh openssh-server
- 配置ssh
- 編輯配置文件`vim /etc/ssh/sshd_config`
- 編輯如下幾項開啓,刪除#號,開啓配置
- 端口與地址
- `Port 22`
- `ListenAddress 0.0.0.0`
- `ListenAddress::`
- 密碼登陸`PasswordAuthentication yes`
- root認證`PermitRootLogin yes`
- 密鑰認證`PubkeyAuthentication yes`
- 開啓ssh服務
- `sudo service sshd start`
- 檢查是否開啓
- `ps -e | grep sshd`
- 查看端口號監聽
- `netstat -an | grep 22`
- 將 sshd 服務添加至自啓動列表中,
- `systemctl enable sshd.service`
- 設置ssh密鑰:
[https://www.runoob.com/w3cnote/set-ssh-login-key.html](https://www.runoob.com/w3cnote/set-ssh-login-key.html "菜鳥ssh密鑰")
3.本機使用Xshell鏈接,新建一個會話,填入名稱,端口,IP地址
輸入用戶名root
輸入密碼
成功鏈接