Host主機i3-6100 3.7Ghz 3M Cache 2核心 DDR4 4G
//VMare 無法使用 修改Bios
UEFI BIOS Utility Version 0604 x64
Advanced Mode --> Advanced --> CPU configuration -->
intel Virtulization Techology -->Enabled
1、CentOs7升級與補強
# yum install lftp
//下載自動修正執行檔:
# lftp ftp.kh.edu.tw
lftp ftp.kh.edu.tw:~> cd pub/APPL/yum/CentOS7/
cd 成功,目前的目錄為 /pub/APPL/yum/CentOS7
lftp ftp.kh.edu.tw:/pub/APPL/yum/CentOS7> ls
-r--r--r-- 1 ftp ftp 1653 Aug 11 2014 CentOS-Base.repo
-r--r--r-- 1 ftp ftp 446 Jan 22 2015 check_reboot.sh
-r--r--r-- 1 ftp ftp 945 Oct 3 2014 epel.repo
-r--r--r-- 1 ftp ftp 1044 Aug 12 2014 epel-testing.repo
-r--r--r-- 1 ftp ftp 1309 Oct 10 08:00 fix-yum-CentOS7.sh
-r--r--r-- 1 ftp ftp 294 Oct 18 2014 get-xrdp.sh
-r--r--r-- 1 ftp ftp 1272 Oct 3 2014 README.CentOS7
lftp ftp.kh.edu.tw:/pub/APPL/yum/CentOS7> get fix-yum-CentOS7.sh
lftp ftp.kh.edu.tw:/pub/APPL/yum/CentOS7> quit
[root@F303 ~]# ls
anaconda-ks.cfg fix-yum-CentOS7.sh
# chmod 755 fix-yum-CentOS7.sh
[root@F303 ~]# ls -l
總計 8
-rw-------. 1 root root 1035 10月 31 09:45 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 1309 10月 10 16:00 fix-yum-CentOS7.sh
# yum install wget
//因應rpmforge套件庫所有的mirror站都在國外,速度很慢
# vi /etc/yum.repos.d/rpmforge.repo
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el7/en/$basearch/rpmforge
mirrorlist = http://mirrorlist.repoforge.org/el7/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
proxy=http://open.kh.edu.tw:3128/
timeout=300
# yum -y update
常用指令:
練習1.
# ip addr show //替代 ifconfig
# ip -s link show eno16777736
# ip link set eno16777736 up //down:關閉 替代 ifconfig eh1 up
# ip link show eno16777736
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:c1:31:fa brd ff:ff:ff:ff:ff:ff
# ip -4 route | column -t //替代 route 顯示路由
# ip -6 route | column -t
# ip neighbr //替代 arp 查詢 IP,MAC 對應
# tracepath 168.95.1.1 //替代traceroute / traceroute6
# ss -tunlp | column -t //替代 netstat , t :TCP 連線 u:UDP連線 l: Lisen
練習2. systemd 基本管理方式
# systemctl --help
# systemctl list-units //查詢目前啟動中服務 替代chkconfig -list
//-a 查詢所有已啟動及未啟動的服務
# systemctl list-unit-files //以檔名顯示
# systemctl start vsftpd.service //stop:停止服務
# systemctl status vsftpd.service //替代chkconfig on|off servicename
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: active (running) since 五 2016-11-25 10:17:00 CST; 1min 1s ago
# systemctl is-active vsftpd.service //是否正常啟動
active
# systemctl enable vsftpd.service //disable:開機不啟動
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
# systemctl is-enabled vsftpd.service
enabled
練習3. 檔案權限
# id //檢視目前使用者uid 和 gid
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
# ls -l kk.txt
-rw-r--r--. 1 root root 13 11月 25 16:06 kk.txt
# chmod 664 kk.txt //r:4 w:2 x:1
# ls -l kk.txt
-rw-rw-r--. 1 root root 13 11月 25 16:06 kk.txt
# chmod 555 -R kk //-R: 同時設定資料夾kk,及包含檔案與子夾
# ls -l
dr-xr-xr-x. 3 root root 15 11月 25 16:12 kk
# chown jack:users kk.txt //chgrp 群組名稱 檔案或目錄
# ls -l
-rw-rw-r--. 1 jack users 13 11月 25 16:06 kk.txt