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地址信息。