1.使用命令:
#vi /etc/sysconfig/network-scripts/ifcfg-eth0 [编辑网卡的配置文件]
2.修改文件中的以下内容:
BOOTPROTO=static
IPADDR=192.168.100.16
PREFIX=255.255.255.0
GATEWAY=192.168.100.1
ONBOOT=yes
DNS1=
192.168
.
1.1
//主DNS服务器IP地址为windows中主机真实网关
3.使用命令:
#service iptables stop#关闭防火墙(可选)
#chkconfig iptables off#设置防火墙不自动开启(可选)
#service network restart#重启网络
一般来讲,经过以上3步就可以连接上了。
注:
连接错误1:The remote system refused the connection.
解决:使用命令:#vi / etc/ssh/sshd_config
找到里面的
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
把前面的注释去掉,再使用命令:#/etc/init.d/sshd restart
连接错误2:Connection Timeout
解决:如果IP等已经设置正确,则使用命令:#service iptables stop