通过ssh实现在本地xp系统下访问虚拟机中的Linux系统
Vmware的网络设置采用NAT方式,希望通过ssh实现在本地xp系统下访问虚拟机中的Linux系统。
1.做地址、端口映射。打开manage virtual network (在开始菜单里,或在VMware界面菜单)。打开NAT页,点击Edit..-> Port Forwarding… -> Add..。
Host Port:22 (主机中的要进行映射的端口)
Virtual Machine IP address : 192.168.253.5 22 (映射到哪个IP,哪个端口)
Description: VMLinux SSH port (简要描述)
2. 确认Linux的SSH服务已经开通
============================================================
linux下开通ssh,允许远程登录
1.ssh是可以代替telnet的一种远程管理的方式.并且具有安全\快捷等优点的一种服务.
2.在shell窗口执行setup命令,选择system service启动sshd服务.如图:
3.在/etc/ssh/sshd_config文件中,将PermitRootLogin no|yes设置为允许root用户远程登录,否则通过putty(一种远程登录工具)虽然能连接上,但是却不能登录.如图:
4./etc/init.d/sshd start 启动ssh服务
/etc/init.d/sshd stop关闭服务
-----------------------------------------------开通FTP服务
/etc/init.d/proftpd start 启动ftp服务
/etc/init.d/proftpd stop 停止ftp服务
添加用户
groupadd ftpuser
useradd shangyu -g ftpuser -d /var/ftp 设置/var/ftp为主目录
passwd shangyu 设置密码
修改/etc/proftpd.conf文件,允许用户在主目录中添加文件.
将stro DenyAll 改为AllowAll
============================================================
3.查看Linux与windows中系统的防火墙设置,关闭它或者打开22端口。
在linux下关闭防火墙:
在ROOT权限下,停掉防火墙:
#service iptables stop
#chkconfig iptables off
============================================================
1、永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
2、即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
============================================================
在windows下打开22端口
通过ssh访问虚拟机下的linux系统:
发起连接:
实现访问: