xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路

在安装好xshell后启动会提示连接
首先进入Linux系统打开终端输入 ifconfig
此时发现提示: bash:ifconfig:conmmand not found
然后输入echo $PATH 发现没有/sbin
xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路此时我们需要将ifconfig命令配置到环境变量
如下操作:root权限下运行 vi /etc/profile
在末尾添加:PATH= $PATH:/sbin
export PATH= $PATH:/sbin
保存并退出
输入命令:source /etc/profile 立即生效后ifconfig命令就可以使用了。
xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路
然后我们在xsell中选择——新建 输入名称,ip,通过SSH进行连接输入账号密码连接成功
xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路
安全警告接受即可。

另外Linux联网步骤如下(桥接模式):
1,root权限进入:vi /etc/sysconfig/network-scripts/ifcfg-eth0
2,进入编辑模式
首先查看自己电脑网络属性
xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路

设置虚拟机主机ip,子网掩码,默认网关,DNS服务器

xshell连接Linux系统;Linux系统ifconfig命令command not found的解决办法!——Linux的学习之路

3,w,q操作保存退出。然后重启即可。