From f8a9f7759f5f9b0fdbc42ac465857d5e35e2623b Mon Sep 17 00:00:00 2001 From: nick Date: Sun, 25 Aug 2019 17:52:36 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BF=AE=E6=94=B9=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git.md | 7 +++++++ used-settings.md | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/git.md b/git.md index 9e73c79..743ad87 100644 --- a/git.md +++ b/git.md @@ -1,3 +1,10 @@ + #### Git 版本控制器 __配置__ diff --git a/used-settings.md b/used-settings.md index dd38825..23a0c6a 100644 --- a/used-settings.md +++ b/used-settings.md @@ -1,3 +1,10 @@ + #### ssh 公私钥登录配置 第一步,在客户端生成公钥 @@ -98,4 +105,23 @@ Port 22228 # ssh 端口,自定义端口,修改为指定端口号 ssh test1 #如果配置了公私钥就直接登录,没有的话输入密码登录 ``` +--- + +#### 修改主机名 + +临时生效,重启服务器会还原 + +``` +hostname ubuntu-1604 +``` + +永久生效 + +1. 修改 `/etc/hostname` 文件中的名称 +2. 修改 `/etc/hosts` 文件中的旧名称,或者新添加一条 `127.0.0.1 ubuntu-1604` + +> 适用于 `Ubuntu 16.04` 和 `CentOS 7` 以上版本 + + +