1. 程式人生 > >CentOS 7安裝完成後初始化

CentOS 7安裝完成後初始化

1、新增使用者

新增名為"wang"的使用者

[[email protected] ~]# useradd wang #新增賬戶
[[email protected] ~]# passwd wang #設定密碼
Changing password for user wang.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[[email protected] ~]# exit #退出

以使用者"wang"為例,設定其為唯一擁有管理員許可權的賬戶

[[email protected] ~]# usermod -G wheel wang
[[email protected] ~]# vim /etc/pam.d/su

#%PAM-1.0
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
# 取消下面一行的註釋
auth            required        pam_wheel.so use_uid
auth            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so
設定root賬戶的郵件轉發

# Person who should get root's mail
# 最後一行,取消註釋,改變使用者名稱稱
root: wang

2、設定防火牆和SELINUX

【1】防火牆

檢視防火牆狀態

[[email protected] ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2016-10-26 01:09:49 CST; 1h 36min ago
 Main PID: 744 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─744 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Oct 26 01:09:46 vdevops.com systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 26 01:09:49 vdevops.com systemd[1]: Started firewalld - dynamic firewall daemon.
防火牆基本操作
[[email protected] ~]# systemctl start firewalld   #啟動防火牆
[[email protected] ~]# systemctl enable firewalld  #設定防火牆開機自啟

預設情況下,“public”區域應用於NIC,dhcpv6-client和ssh是允許的。當使用“firewall-cmd”命令操作時,如果輸入命令不帶“--zone = ***”規範,則配置設定為預設區域。

#顯示預設區域
[[email protected] ~]# firewall-cmd --get-default-zone 
public
#顯示當前設定
[[email protected] ~]# firewall-cmd --list-all
public (default, active)
  interfaces: eno16777736
  sources: 
  services: dhcpv6-client ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
#顯示全部區域
[[email protected] ~]# firewall-cmd --list-all-zones
block
  interfaces: 
  sources: 
  services: 
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
    
dmz
  interfaces: 
  sources: 
  services: ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
...
#顯示特定區域允許的服務
[[email protected] ~]# firewall-cmd --list-service --zone=external
ssh
#改變預設區域
[[email protected] ~]# firewall-cmd --set-default-zone=external
success
#改變制定區域的介面
[[email protected] ~]# firewall-cmd --change-interface=eth1 --zone=external
success
#顯示制定區域的狀態
[[email protected] ~]# firewall-cmd --list-all --zone=external
external (default, active)
  interfaces: eno16777736 eth1
  sources: 
  services: ssh
  ports: 
  masquerade: yes
  forward-ports: 
  icmp-blocks: 
  rich rules: 
#注:改變制定區域的介面,前提是次介面在當前系統是存在的
顯示預設定義的服務
[[email protected] ~]# firewall-cmd --get-services
RH-Satellite-6 amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns freeipa-ldap freeipa-ldaps freeipa-replication ftp high-availability http https imaps ipp ipp-client ipsec iscsi-target kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind rsyncd samba samba-client smtp ssh telnet tftp tftp-client transmission-client vdsm vnc-server wbem-https
#定義檔案路徑如下,如果需要新增新的定義檔案,在下面目錄新增相應的XML檔案
[[email protected] ~]# ls /usr/lib/firewalld/services 
amanda-client.xml  freeipa-ldap.xml         ipp.xml           libvirt.xml  pmcd.xml        RH-Satellite-6.xml  tftp-client.xml
bacula-client.xml  freeipa-replication.xml  ipsec.xml         mdns.xml     pmproxy.xml     rpc-bind.xml        tftp.xml
bacula.xml         ftp.xml                  iscsi-target.xml  mountd.xml   pmwebapis.xml   rsyncd.xml          transmission-client.xml
dhcpv6-client.xml  high-availability.xml    kerberos.xml      ms-wbt.xml   pmwebapi.xml    samba-client.xml    vdsm.xml
dhcpv6.xml         https.xml                kpasswd.xml       mysql.xml    pop3s.xml       samba.xml           vnc-server.xml
dhcp.xml           http.xml                 ldaps.xml         nfs.xml      postgresql.xml  smtp.xml            wbem-https.xml
dns.xml            imaps.xml                ldap.xml          ntp.xml      proxy-dhcp.xml  ssh.xml
freeipa-ldaps.xml  ipp-client.xml           libvirt-tls.xml   openvpn.xml  radius.xml      telnet.xml
新增或刪除允許的服務,重新啟動系統後,更改將恢復。如果永久更改設定,請新增“--permanent”選項。
#以新增http服務為例
[[email protected] ~]# firewall-cmd --add-service=http
success
[[email protected] ~]# firewall-cmd --list-service
http ssh
#移除新增的http
<pre name="code" class="html">[[email protected] ~]# firewall-cmd --remove-service=http
success
[[email protected] ~]# firewall-cmd --list-service
ssh
#新增http服務,永久生效 
[[email protected] ~]# firewall-cmd --add-service=http --permanentsuccess
[[email protected] ~]# firewall-cmd --reloadsuccess[[email protected] ~]# firewall-cmd --list-servicehttp ssh
新增和移除埠
[[email protected] ~]# firewall-cmd --add-port=465/tcp                #新增埠
success
[[email protected] ~]# firewall-cmd --list-port
465/tcp
[[email protected] ~]# firewall-cmd --remove-port=465/tcp             #移除埠
success
[[email protected] ~]# firewall-cmd --list-port
[[email protected] ~]# firewall-cmd --add-port=465/tcp --permanent    #新增埠,永久生效
success
[[email protected] ~]# firewall-cmd --reload
success
[[email protected] ~]# firewall-cmd --list-port
465/tcp
加或刪除禁止的ICMP型別
[[email protected] ~]# firewall-cmd --add-icmp-block=echo-request      #新增禁止迴應請求
success
[[email protected] ~]# firewall-cmd --list-icmp-blocks
echo-request
[[email protected] ~]# firewall-cmd --remove-icmp-block=echo-request   #移除新增的引數
success
[[email protected] ~]# firewall-cmd --list-icmp-blocks
[[email protected] ~]# firewall-cmd --get-icmptypes                    #顯示ICMP支援的功能
destination-unreachable echo-reply echo-request parameter-problem redirect
router-advertisement router-solicitation source-quench time-exceeded 
【2】如果不需要防火牆服務,關閉如下
[[email protected] ~]# systemctl stop firewalld                      #停止防火牆服務
[[email protected] ~]# systemctl disable firewalld                   #禁止防火牆開機自啟
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
3、SELinux
[[email protected] ~]# getenforce                 #檢視SELINUX工作模式
Enforcing
[[email protected] ~]# sed -i 's/SELINUX=Enforcing/SELINUX=disabled/' /etc/selinux/config    #禁用SELINUX
[[email protected] ~]# setenforce 0                #臨時禁用SELINUX,無需重啟
4、網路設定
【1】、設定靜態IP和改變介面名稱
[[email protected] ~]# nmcli c modify eno16777736 ipv4.addresses 10.1.1.56/24           #設定靜態IP
[[email protected] ~]# nmcli c modify eno16777736 ipv4.gateway 10.1.1.1                 #設定閘道器
[[email protected] ~]# nmcli c modify eno16777736 ipv4.dns 10.1.1.1                     #設定DNS
[[email protected] ~]# nmcli c modify eno16777736 ipv4.method manual                    #設定ipv4的型別為靜態
[[email protected] ~]# nmcli c down eno16777736;nmcli c up eno16777736                  #重啟網路介面
Connection 'eno16777736' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
[[email protected] ~]# nmcli d show eno16777736                                         #檢視網路介面狀態
GENERAL.DEVICE:                         eno16777736
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         00:0C:29:B6:F5:5E
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     eno16777736
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         10.1.1.56/24
IP4.GATEWAY:                            10.1.1.1
IP4.DNS[1]:                             10.1.1.1
IP6.ADDRESS[1]:                         fe80::20c:29ff:feb6:f55e/64
IP6.GATEWAY:                            
[[email protected] ~]# ip addr show                                                     #檢視IP狀態
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:b6:f5:5e brd ff:ff:ff:ff:ff:ff
    inet 10.1.1.56/24 brd 10.1.1.255 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:feb6:f55e/64 scope link 
       valid_lft forever preferred_lft forever
【2】禁用IPV6
[[email protected] ~]# vim /etc/default/grub 
#第六行,新增
GRUB_CMDLINE_LINUX="crashkernel=auto <span style="color:#FF0000;">ipv6.disable=1</span> rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
[[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.36.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.36.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d1b9467b8b744a3db391f2c15fe58a94
Found initrd image: /boot/initramfs-0-rescue-d1b9467b8b744a3db391f2c15fe58a94.img
done
[[email protected] ~]# reboot   #重啟系統
【3】如果要將網路介面名稱用作ethX,請按如下所示進行配置。
[[email protected] ~]# vim /etc/default/grub 
#第六行新增
GRUB_CMDLINE_LINUX="crashkernel=auto ipv6.disable=1 <span style="color:#FF0000;">net.ifnames=0</span> rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
[[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.36.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.36.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d1b9467b8b744a3db391f2c15fe58a94
Found initrd image: /boot/initramfs-0-rescue-d1b9467b8b744a3db391f2c15fe58a94.img
done
4、服務設定
[1]、檢視服務狀態
# 顯示正在執行的服務
[[email protected] ~]# systemctl -t service
UNIT                                    LOAD   ACTIVE SUB     DESCRIPTION
auditd.service                          loaded active running Security Auditing Service
avahi-daemon.service                    loaded active running Avahi mDNS/DNS-SD Stack
crond.service                           loaded active running Command Scheduler
dbus.service                            loaded active running D-Bus System Message Bus
[email protected]                      loaded active running Getty on tty1
...
...
...
systemd-udevd.service                   loaded active running udev Kernel Device Manager
systemd-update-utmp.service             loaded active exited  Update UTMP about System Reboot/Shutdown
systemd-user-sessions.service           loaded active exited  Permit User Sessions
systemd-vconsole-setup.service          loaded active exited  Setup Virtual Console
tuned.service                           loaded active running Dynamic System Tuning Daemon

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

39 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

# 顯示所有服務
[[email protected] ~]# systemctl list-unit-files -t service

UNIT FILE                               STATE
auditd.service                          enabled
[email protected]                         disabled
avahi-daemon.service                    enabled
blk-availability.service                disabled
brandbot.service                        static
...
...
...
systemd-user-sessions.service           static
systemd-vconsole-setup.service          static
[email protected]                          static
tuned.service                           enabled
wpa_supplicant.service                  disabled

125 unit files listed.
[2]、設定停止啟動自動的服務
[[email protected] ~]# systemctl stop postfix                      #停止服務
[[email protected] ~]# systemctl disable postfix                    
Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
[[email protected] ~]# systemctl start postfix
[[email protected] ~]# systemctl enable postfix
Created symlink from /etc/systemd/system/multi-user.target.wants/postfix.service to /usr/lib/systemd/system/postfix.service.
[[email protected] ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2016-10-26 18:40:35 CST; 15s ago
 Main PID: 10071 (master)
   CGroup: /system.slice/postfix.service
           ├─10071 /usr/libexec/postfix/master -w
           ├─10072 pickup -l -t unix -u
           └─10073 qmgr -l -t unix -u

Oct 26 18:40:35 vdevops.com postfix[9999]: /usr/sbin/postconf: warning: inet_protocols: disabling IPv6 name/address support: Address ...rotocol
Oct 26 18:40:35 vdevops.com postfix[9999]: /usr/sbin/postconf: warning: inet_protocols: disabling IPv6 name/address support: Address ...rotocol
Oct 26 18:40:35 vdevops.com postfix[9999]: postsuper: warning: inet_protocols: disabling IPv6 name/address support: Address family no...rotocol
Oct 26 18:40:35 vdevops.com postfix[9999]: /usr/sbin/postconf: warning: inet_protocols: disabling IPv6 name/address support: Address ...rotocol
Oct 26 18:40:35 vdevops.com postfix/master[10071]: warning: inet_protocols: disabling IPv6 name/address support: Address family not s...rotocol
Oct 26 18:40:35 vdevops.com postfix/master[10071]: warning: inet_protocols: disabling IPv6 name/address support: Address family not s...rotocol
Oct 26 18:40:35 vdevops.com postfix/master[10071]: daemon started -- version 2.10.1, configuration /etc/postfix
Oct 26 18:40:35 vdevops.com systemd[1]: Started Postfix Mail Transport Agent.
Oct 26 18:40:35 vdevops.com postfix/qmgr[10073]: warning: inet_protocols: disabling IPv6 name/address support: Address family not sup...rotocol
Oct 26 18:40:35 vdevops.com postfix/pickup[10072]: warning: inet_protocols: disabling IPv6 name/address support: Address family not s...rotocol
Hint: Some lines were ellipsized, use -l to show in full.
[3]、還有一些SysV服務。它們由chkconfig控制,如下所示
[[email protected] ~]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

netconsole     	0:off	1:off	2:off	3:off	4:off	5:off	6:off
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
5、更新系統新增其他源
yum update -y

新增其它源
新增一些有用的外部儲存庫來安裝有用的軟體
【1】安裝外掛以向每個安裝的儲存庫新增優先順序。
 [[email protected] ~]# yum -y install yum-plugin-priorities
# 設定官方源的優先順序為[priority=1]
[[email protected] ~]# sed -i -e "s/\]$/\]\npriority=1/g" /etc/yum.repos.d/CentOS-Base.repo 
【2】新增從Fedora專案提供的EPEL儲存庫
 [[email protected] ~]# yum -y install epel-release
# 設定優先順序[priority=5]
[[email protected] ~]# sed -i -e "s/\]$/\]\npriority=5/g" /etc/yum.repos.d/epel.repo

# 可以通過設定enabled=0,來控制安裝軟體包時使用相應的源
[[email protected] ~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo

# 如果[enabled=0], 使用下面命令安裝軟體包
[[email protected] ~]# yum --enablerepo=epel install [Package]
【3】新增CentOS SCLo軟體集合儲存庫。
 [[email protected] ~]# yum -y install centos-release-scl-rh centos-release-scl
# 設定優先順序[priority=10]
[[email protected] ~]# sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[[email protected] ~]# sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

# 設定 [enabled=0]
[[email protected] ~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[[email protected] ~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

# 設定[enabled=0], 通過下面命令使用相應源
[[email protected] ~]# yum --enablerepo=centos-sclo-rh install [Package]
[[email protected] ~]# yum --enablerepo=centos-sclo-sclo install [Package]
【4】新增Remi的RPM儲存庫,它提供了許多有用的包
 [[email protected] ~]# yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# 設定優先順序 [priority=10]
[[email protected] ~]# sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/remi-safe.repo 
6、配置特色的vim
【1】安裝vim
[[email protected] ~]# yum -y install vim-enhanced
【2】設定別名
設定命令別名。 (適用於以下所有使用者,如果您申請某個使用者,請在“〜/ .bashrc”中寫入相同的設定)
 [[email protected] ~]# vi /etc/profile
# 在最後新增下面一行內容
alias vi='vim'
[[email protected] ~]# source /etc/profile  #過載
或者
echo "alias vi='vim'" >> /etc/profile && source /etc/profile
【3】配置vim,針對所有使用者生效修改/etc/vimrc,針對特定使用者生效修改~/.vimrc
主要用語法高亮,外掛使用,自動縮排等功能,本文不做詳細操作,後續會專門寫一篇關於優化vim使用的博文,工欲善其事必先利其器
7、設定sudo
配置sudo以區分使用者的職責,如果一些人共享許可權,必手動安裝sudo,因為它預設安裝,即使“最小安裝”
【1】設定普通使用者擁有root的所有許可權
 [[email protected] ~]# visudo
#  新增下面一行,使使用者“wang”擁有root的所有許可權
wang    ALL=(ALL)       ALL

# 普通使用者使用root命令
# 確保使用者為 'wang'

[[email protected] ~]$ /usr/bin/cat /etc/shadow
cat: /etc/shadow: Permission denied# denied normally
[[email protected] ~]$ sudo /usr/bin/cat /etc/shadow

[sudo] password for cent:# own password

daemon:*:16231:0:99999:7:::
adm:*:16231:0:99999:7:::
lp:*:16231:0:99999:7:::
...
...
# 輸入wang的密碼可以看到執行結果
【2】設定使用者不能執行危險命令
 [[email protected] ~]# visudo
# 49行: 定義別名SHUTDOWN

Cmnd_Alias SHUTDOWN = /sbin/halt, /sbin/shutdown, /sbin/poweroff, /sbin/reboot, /sbin/init
# 設定使用者wang不能執行別名SHUTDOWN對應的命令
wang ALL=(ALL) ALL, !SHUTDOWN
# 確保使用者為'wang'
[[email protected] ~]$ sudo /sbin/shutdown -r now

Sorry, user cent is not allowed to execute '/sbin/shutdown -r now' as root on vdevops.com.   # denied normally
【3】建立一個特殊的組,組使用者可以執行部分root命令
 [[email protected] ~]# visudo
# 51行: 為管理使用者的幾個命令設定別名為USERMGR

Cmnd_Alias USERMGR = /usr/sbin/useradd, /usr/sbin/userdel, /usr/sbin/usermod, /usr/bin/passwd

# 最後一行新增
%usermgr ALL=(ALL) USERMGR
[[email protected] ~]# groupadd usermgr

[[email protected] ~]# usermod -G usermgr wang

# 確保使用者為wang
[[email protected] ~]$ sudo /usr/sbin/useradd testuser
#輸入使用者wang的密碼,檢視建立結果,顯示成功
[[email protected] ~]$ sudo /usr/bin/passwd testuser
Changing password for user testuser.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully. 
【4】設定sudo日誌
sudo的日誌儲存在/ var / log / secure中,但它中有很多種類的日誌。如果你想保持只有sudo的日誌在一個檔案,設定如下:
[[email protected] ~]# visudo
# 最後一行新增
Defaults syslog=local1
[[email protected] ~]# vi /etc/rsyslog.conf
# 在54行修改,新增<span style="color:#FF6666;">local1.none</span>
*.info;mail.none;authpriv.none;cron.none;<span style="color:#FF6666;">local1.none</span>
  /var/log/messages
# 新增下面一行內容
local1.*                                                /var/log/sudo.log

[[email protected] ~]# systemctl restart rsyslog    #重啟rsyslog服務

























相關推薦

CentOS 7安裝完成初始

1、新增使用者 新增名為"wang"的使用者 [[email protected] ~]# useradd wang #新增賬戶 [[email protected] ~]# passwd wang #設定密碼 Changing password for

CentOS Linux release 7 安裝完成停止幾個服務

CentOS Linux release一、停止郵件服務[root@localhost ~]# systemctl stop postfix # 臨時關閉[root@localhost ~]# sy

MySQL 5.7 安裝完成,首次登陸的幾個問題

centos grep lock pri using net 什麽 roo nbsp Server:CentOS 7.0 MySQL : 5.7.20 MySQL Community Server (GPL) 1.首次登陸後修改密碼: 根據安裝時的選擇不同,有mysql

mysql8.0.11安裝成功初始臨時密碼報錯

安裝mysql8.0.11成功後檢視mysql版本號 PS C:\WINDOWS\system32> mysql --version C:\Software\mysql-8.0.11-winx64\bin\mysql.exe Ver 8.0.11 fo

Centos 7 安裝 gitlab 以及漢

一:安裝   1:新增yum配置檔案 # vim /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6

虛擬機Cent OS 7 最小安裝初始

pro 配置 一個 user centos7 ets /etc/ 基本 fig # 修改網絡配置# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3# enp0s3 是CentOS7的eth0# ONBOOT=no 修改為# ON

Android應用安裝完成開啟應用出現初始兩次解決方案

 啟動介面加上 if (!isTaskRoot()) { finish(); return; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(

mariaDB安裝完成設定root密碼等初始操作

修改root密碼 1.以root身份在終端登陸(必須) 2.輸入 mysqladmin -u root -p password ex 後面的 ex 是要設定的密碼 3.回車後出現 Enter password  輸入就密碼,如果沒有,直接回車 開啟遠端訪問許可權 M

解決CentOS 7安裝沒有killall、ifconfig、命令補全

centos7從centos6 轉到centos7發現少了很多常用命令,下面就常見的幾個做一個說明解決辦法沒有killall命令:yum install -y psmisc沒有ifconfig命令:yum install -y net-tools沒有命令補全: yum install -y bash-com

初次安裝Mysql5.7以上版本初始root密碼找不到的問題

初次安裝Mysql5.7以上版本後初始rmysql5.7新增的特性中主要的一方面就是極大增強了安全性,安裝Mysql後默認會為root@localhost用戶創建一個隨機密碼,這個隨機密碼在不同系統上需要使用不同方式查找,否則無法登錄mysql並修改初始密碼。以下以Centos 7為例介紹如何找到初始的隨機密

CentOS 7安裝的配置

net shu www -m rest 我們 重啟 name AR 一、設置IP地址、網關DNS 說明:CentOS 7.x默認安裝好之後是沒有自動開啟網絡連接的,所 以需要我們自己配置。 在命令行輸入#vi /etc/sysconfig/network-

MikroTik RouterOS安裝初始配置(PPPOE撥號上網)

sts 瀏覽器 表示 完成 src dash allow 撥號上網 dia 1、修改登入密碼 路由器默認登入賬號為admin,密碼為空,強烈建議修改登入密碼保證安全: 2、修改接口名稱 選擇Interface,切換到Ethernet標簽,找到狀態是R(ru

ubuntu 初始安裝完成的一些設定

處於安全考慮最好,使用普通使用者登入。 首先以超級使用者登入系統,然後執行以下步驟 第一步:設定普通使用者 以下<user_name>代表普通使用者的使用者名稱 useradd -g users -d /home/user_name -m -s /bin/bash user_nam

CentOs 7 安裝chrome瀏覽器 安裝沒有復原環境

首先當然選擇在系統自帶的application installer中直接安裝, 可是不成功 提示installing not available 下載rpm軟體包試試 rpm -ivh google-chrome-stable_current_x86_64.rpm 會提示缺少依賴

CentOS 7 安裝基本配置

1、檢查環境 [[email protected] etc]# cat /etc/system-release CentOS Linux release 7.3.1611 (Core) 2、修改ip cd /etc/sysconfig/network-

CentOS 7 安裝圖形介面

        CentOS 比較適合用作伺服器的系統,之前用過 CentOS 6,但是在配置 Nginx 的時候,發現很多語句版本7的系統都進行了更新,而且網上針對版本7的例子會更多一下,遂將系統換成版本7。        

CentOS 7靜默安裝Oracle 11g(記一次最小CentOS 7安裝Oracle 11g的經歷)

1.最小化安裝CentOS 7後首先設定一下固定IP可以先查詢一下自己的網絡卡裝置的名稱,是ens33,所以網絡卡配置檔名稱就是ifcfg-ens33(前面的ifcfg-不用管,固定的)ip addr開啟網絡卡配置檔案:vi /etc/sysconfig/network-sc

Centos 7 安裝 Python3.5.2yum不能正常使用的解決辦法

Centos 7後自帶Python2.7.5, 考慮到 Python3更新的內容比較多,於是安裝 Python3.5.2 來學習, 搭建了一個測試網站(hello.py) 後發現後臺還是以 Python 2.7.5 的環境執行 hello.py. 讓系統以 Python

Digitalocean VPS centos 7安裝圖形介面KDE和VNC實現遠端圖形操作

VPS遠端操作用的最多的是SSH,有時候一些特殊需求也要用到遠端圖形化操作,比如使用在VPS上使用瀏覽器訪問網站。本文以Digitalocean VPS為例分享如何安裝KDE和VNC實現遠端圖形介面訪問。如果要購買Digitalocean VPS,建議使用Digit

CentOS 7安裝無法聯網

使用U盤安裝,在安裝介面按了下tab鍵, 將vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet 改為:   vmlinuz initrd=initr