search
HomeOperation and MaintenanceCentOSWhat to do if xshell fails to connect to centos

xshell连接centos失败的解决办法:1、打开虚拟机,设置子网IP;2、设置网关IP;3、修改网卡文件内容;4、通过“systemctl restart network”重启网络即可。

What to do if xshell fails to connect to centos

本文操作环境:CentOS 7系统、DELL G3电脑

xshell连接centos失败怎么办?

Xshell连接CentOS失败,记录一次CentOS7.6网络连接的步骤(笔记)

问题:本来在公司可以正常连接网络,回到学校换了学校的无线网络之后连接不上网络,Xshell连接Linux失败,CentOSping外网不通,这里记录一下解决办法(通过设置Linux静态Ip)。

  1. 打开虚拟机-编辑-虚拟网络编辑器-设置子网IP
    What to do if xshell fails to connect to centos

  2. 上图打开NAT设置之后,设置网关IP(要和子网IP在一个网段)
    What to do if xshell fails to connect to centos

  3. 修改网卡文件内容,使用vim模式打开网卡文件

    打开网卡文件命令:
    vi /etc/sysconfig/network-scripts/ifcfg-ens33
    如果不知道网卡文件名,可以使用以下命令查看:
    ll /etc/sysconfig/network-scripts/ | grep ifcfg-en
    打开之后修改和添加如下:
    What to do if xshell fails to connect to centos

BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.25.73
GATEWAY=192.168.25.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
  • IPADDR:为设置的IP,更改为和子网IP在同一网段的自定义IP
  • GATEWAY:为虚拟网络编辑器设置的网关IP,这个要与自己的网关IP一致(注意)
  • NETMASK:子网掩码
  • 其它都一致即可

查看网关IP:
What to do if xshell fails to connect to centos

  1. 设置完成之后,保存退出,重启网络systemctl restart network
  2. 查看CentOS中的IP,通过ip addr命令查看
    What to do if xshell fails to connect to centos
  3. 打开WIndows下的命令行,输入cmd进入命令行,然后输入ipconfig命令查看IP,确保和CentOS下的IP在同一个网段即为设置成功
    What to do if xshell fails to connect to centos
  4. 设置成功之后,本机pingCentOS,CentOSping本机,CentOSping外网都可以成功!!!

推荐:《centos使用教程

The above is the detailed content of What to do if xshell fails to connect to centos. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Xshell如何设置背景颜色-Xshell设置背景颜色的方法Xshell如何设置背景颜色-Xshell设置背景颜色的方法Mar 04, 2024 pm 10:22 PM

说到Xshell软件,相信在座的用户都不陌生,不过你们知道Xshell如何设置背景颜色吗?以下文章就带来了Xshell设置背景颜色的方法,感兴趣的用户快来下文看看吧。如何设置xshell的背景颜色打开xshell工具,点击菜单栏---选项卡点击选项卡,可以选择设置颜色,如黄色,紫色红色比如选择红色,那么选项卡背景就变成了红色的工具栏颜色变更刚刚是选项卡的演示变更,工具栏颜色调整不了,可以改成透明和默认的简单模式如图,左左勾选透明模式。工具背景修改如果要修改远程窗口背景,可以选择工具--配色方案根

Xshell如何快速复制粘贴-Xshell快速复制粘贴的方法Xshell如何快速复制粘贴-Xshell快速复制粘贴的方法Mar 04, 2024 pm 02:30 PM

很多用户刚刚接触Xshell软件,并不熟悉Xshell如何快速复制粘贴?以下文章就为各位带来了Xshell快速复制粘贴的方法,让我们一起来下文看看吧。使用常用的复制粘贴命令,Ctrl+C、Ctrl+V在Xshell中不起作用,经查看发现Xshell中默认的复制、粘贴命令不一样,如下使用Xshell默认复制粘贴命令,可复制粘贴信息,但是不及常用复制粘贴命令速度跟方便设置快速复制信息:工具—选项—键盘和鼠标,勾选【将选定的文本自动复制的粘贴板】,并确认设置快速粘贴信息:工具—选项—键盘和鼠标—向右按

centos7怎么查看php安装目录?三种方法分享centos7怎么查看php安装目录?三种方法分享Mar 22, 2023 am 10:38 AM

如果你正在使用 CentOS 7 操作系统,需要查看 PHP 安装目录以便定位配置文件、扩展等相关信息,那么就需要了解一些相关命令和技巧。下面,我们将为您介绍一些方法来查看 CentOS 7 上的 PHP 安装目录。

怎么在CentOS7中使用Nginx和PHP7-FPM安装Nextcloud怎么在CentOS7中使用Nginx和PHP7-FPM安装NextcloudMay 24, 2023 pm 08:13 PM

先决条件64位的centos7服务器的root权限步骤1-在centos7中安装nginx和php7-fpm在开始安装nginx和php7-fpm之前,我们还学要先添加epel包的仓库源。使用如下命令:yum-yinstallepel-release现在开始从epel仓库来安装nginx:yum-yinstallnginx然后我们还需要为php7-fpm添加另外一个仓库。互联网中有很个远程仓库提供了php7系列包,我在这里使用的是webtatic。添加php7-fpmwebtatic仓库:rpm

CentOS7如何安装Nginx并配置自动启动CentOS7如何安装Nginx并配置自动启动May 14, 2023 pm 03:01 PM

1、官网下载安装包选择适合linux的版本,这里选择最新的版本,下载到本地后上传到服务器或者centos下直接wget命令下载。切换到/usr/local目录,下载软件包#cd/usr/local#wgethttp://nginx.org/download/nginx-1.11.5.tar.gz2、安装nginx先执行以下命令,安装nginx依赖库,如果缺少依赖库,可能会安装失败,具体可以参考文章后面的错误提示信息。#yuminstallgcc-c++#yuminstallpcre#yumins

CentOS7下怎么部署php7.1和开启MySQL扩展CentOS7下怎么部署php7.1和开启MySQL扩展May 28, 2023 pm 03:01 PM

简单安装(yum方式)安装软件源添加epel源[root@opstrip.comopt]#rpm--import/etc/pki/rpm-gpg/rpm-gpg-key*[root@opstrip.comopt]#rpm-uvhhttp://mirrors.rit.edu/fedora/epel//7/x86_64/e/epel-release-7-9.noarch.rpm添加remi源[root@opstrip.comopt]#rpm-uvhhttp://rpms.remirepo.net/e

Xshell如何更改界面语言-Xshell更改界面语言的方法Xshell如何更改界面语言-Xshell更改界面语言的方法Mar 05, 2024 pm 01:31 PM

很多的用户在使用Xshell软件的时候,不熟悉Xshell如何更改界面语言?下面这篇文章就为各位带来了Xshell更改界面语言的方法,让我们一同来下文看看吧。打开xshell后,点击上方的工具按钮,如图:在打开的菜单中,点击更改语言,如图:在语言界面,根据需要选择显示的语言,如图:选择完成后,点击下方的确定按钮即可,如图:

Xshell怎么设置编码-Xshell设置编码的方法Xshell怎么设置编码-Xshell设置编码的方法Mar 05, 2024 pm 11:20 PM

很多用户在电脑中都在使用Xshell软件,不过你们知道Xshell怎么设置编码吗?下面小编就为各位带来了Xshell设置编码的方法,感兴趣的用户一同来下文看看吧。第一步在我们的电脑上打开xshell,点击上方的编码图标,如下图所示:第二步点击编码图标之后,可以看到勾选的默认语言,如下图所示:第三步我们将xshell编码改为“utf-8”,如下图所示:第四步这个时候我们在去通过xshell操作服务器linux系统,可以看到中文正常显示,如下图所示:第五步如果没有utf-8编码,可以选择其他->gb

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!