SecureCRT 鏈接本地linux虛擬機

SecureCRT 鏈接本地linux虛擬機
linux


經過ssh鏈接到虛擬機,首先須要在虛擬機中安裝openssh-client,如未安裝經過命令bash

mhchen@mhchen-VirtualBox:~$ sudo apt-get install openssh-server
[sudo] password for mhchen: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openssh-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 323 not upgraded.
mhchen@mhchen-VirtualBox:~$

提示已經安裝過openssh-client.服務器


檢查sshserver是否啓動:
dom

mhchen@mhchen-VirtualBox:~$ ps -e |grep ssh
 2225 ?        00:00:00 ssh-agent
 5580 ?        00:00:00 sshd
 5651 ?        00:00:00 sshd
 5714 ?        00:00:00 sshd
 5846 ?        00:00:00 sshd
 5887 ?        00:00:00 sshd
mhchen@mhchen-VirtualBox:~$


若是隻有ssh-agent說明ssh-server還沒啓動,須要到/etc/init.d/ssh 執行start,若是看到sshd說明服務已啓動。ssh


ssh-server配置文件位於/etc/ssh/sshd_config,在這可定義SSH服務端口,默認22。可定義其餘端口如:220,重啓服務tcp

mhchen@mhchen-VirtualBox:~$ sudo /etc/init.d/ssh restart 
ssh stop/waiting
ssh start/running, process 5990
mhchen@mhchen-VirtualBox:~$

最後肯定ssh-server已正常工做。
ide

mhchen@mhchen-VirtualBox:~$ netstat -tpl
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 mhchen-VirtualBo:domain *:*                     LISTEN      -               
tcp        0      0 *:ssh                   *:*                     LISTEN      -               
tcp        0      0 localhost:ipp           *:*                     LISTEN      -               
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      -               
tcp6       0      0 ip6-localhost:ipp       [::]:*                  LISTEN      -               
mhchen@mhchen-VirtualBox:~$

看到ssh的tcp信息就說明ssh-server已經正常運行。
ui


經過secureCRT可遠端至服務器了。spa



檢查服務器ip地址。rest

mhchen@mhchen-VirtualBox:~$ ifconfig

能夠看到eth0的IP地址信息。

相關文章
相關標籤/搜索