centos cpe,centos7安装第三方软件

大家好,今天来为大家分享centos cpe的一些知识点,和centos7安装第三方软件的问题解析,大家要是都明白,那么可以忽略,如果不太清楚的话可以看看本篇文章,相信很大概率可以解决您的问题,接下来我们就一起来看看吧!

CentOS7的hostnamectl命令使用详解

centos7上在主机名变更新增了一个hostnamectl指令,该指令的无论在输出和更改上都较之前更加的便利。先看下hostname的help帮助信息:

复制代码代码如下:

[root@361way~]# hostnamectl--help

hostnamectl [OPTIONS...] COMMAND...

Query or change system hostname.

-h--help Show this help

--version Show package version

--transient Only set transient hostname

--static Only set static hostname

--pretty Only set pretty hostname

-P--privileged Acquire privileges before execution

--no-ask-password Do not prompt for password

-H--host=[USER@]HOST Operate on remote host

Commands:

status Show current hostname settings

set-hostname NAME Set system hostname

set-icon-name NAME Set icon name for host

set-chassis NAME Set chassis type for host

查看hostname信息

复制代码代码如下:

[root@361way~]# hostnamectl

Static hostname: 361way

Icon name: computer-desktop

Chassis: desktop

Machine ID: 6917731f5fe447d0bca296ed2802e250

Boot ID: e0d20bc2a3a4474c960394967d33ab53

Operating System: CentOS Linux 7(Core)

CPE OS Name: cpe:/o:centos:centos:7

Kernel: Linux 3.10.0-123.6.3.el7.x86_64

Architecture: x86_64

设置主机名

从上面的help帮助里可以看到,在设置主机名时,这里涉及到四种主机名,在hostnamectl的man手册里给予了说明和解释,如下:

This tool distinguishes three different hostnames: the high-level"pretty" hostname which might include all kinds of special characters(e.g."Lennart's

Laptop"), the static hostname which is used to initialize the kernel hostname at boot(e.g."lennarts-laptop"), and the transient hostname which might be

assigned temporarily due to network configuration and might revert back to the static hostname if network connectivity is lost and is only temporarily

written to the kernel hostname(e.g."dhcp-47-11").

Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted

characters of Internet domain names.

更改主机名

一般情况下都是使用set-hostname进行更改:

复制代码代码如下:

[root@361way~]# hostnamectl set-hostname blog

更改主机名一般会涉及到/etc/hostname、/etc/machine-info两个文件,同时对于不同的名字修改在man手册上也给了说明:

The static hostname is stored in/etc/hostname, see hostname(5) for more information. The pretty hostname, chassis type, and icon name are stored in/etc/machine-info, see machine-id(5).

set-icon-name设置的主机一般和图形界面会用到,对应的hostnamectl输出中的Icon name,set-chassis指定了主机的平台类型,如本机的是desktop,还可以设置为:"desktop","laptop","server","tablet","handset"

centos设置主机名 linux怎么设置主机名

1

首先对于刚刚安装的linux系统一般都是默认的,localhostlocaldomain.com。通过命令hostname可以查看

2

临时修改主机名

通过hostsname主机名格式临时设置主机名,这个方法重启系统之后就失效了

END

怎么设置centos的主机名(字符界面)

1

首先我们需要先把centos的网络配置文件,/etc/sysconfig/network把hostname栏目修改

2

通过vi修改好之后,保存退出。再次查看确认是不是已经改好了

3

设置主机表

对于windows主机名有一个主机表来控制,linux下面也有。位置在/etc/hosts下面

4

设置修改如图红色框框部分即可,设置保存。同样再确认一下

5

设置好以上配置文件之后,重启一下操作系统。可以通过reboot命令重启

END

图形界面设置

以上都是通过命令行设置,如果对vi不熟悉的话。也可以通过命令setup进入图形网络配置界面

找到network configuration(中文的话是网络配置),接着找到dns configuration选项

打开dns配置界面,找到第一项如图 hostname就是主机名了。设置添加进去

以上设置是修改电脑的主机名,但是对于主机解析IP的话。找到域名解析dns服务器地址设置里面(这里的解析也可以解析主机名对应的ip,如果hosts文件里面设置了那就是hosts文件优先)

linux查看当前是redhat还是centos

方法:[root@localhost~]# cat/proc/version Linux version 3.10.0-327.el7.x86_64(builder@kbuilder.dev.centos.org)(gcc version 4.8.3 20140911(Red Hat 4.8.3-9)(GCC))#1 SMP Thu Nov 19 22:10:57 UTC 2015。

拓展:

1、Linux操作系统是基于UNIX操作系统发展而来的一种克隆系统,它诞生于1991年的 [Linux桌面] 10月5日(这是第一次正式向外公布的时间)。以后借助于Internet网络,并通过全世界各地计算机爱好者的共同努力,已成为今天世界上使用最多的一种UNIX类操作系统,并且使用人数还在迅猛增长。

2、Linux操作系统是UNIX操作系统的一种克隆系统,它诞生linux系统于1991年的10月5日(这是第一次正式向外公布的时间)。以后借助于Internet网络,并通过全世界各地计算机爱好者的共同努力,已成为今天世界上使用最多的一种UNIX类操作系统,并且使用人数还在迅猛增长。

阅读剩余
THE END