2012年2月23日 星期四
2012年2月22日 星期三
Red rhcsa 考試心得與指令
過年年參加學校舉辦的RHCSA為期五天的特訓上完課直接進行考試,第一次因為ip問題與DNS問題delay30分鐘,真是有點無言到,是自己沒看清楚@@差20分及格不過第二次通過了︿︿同時也要謝謝指導老師給我這機會參加,以下為我考試遇到題目與各位分享
在開啟虛擬機之前必須完成實體機器的ip (使用圖型介面即可)設定與hostname vi/etc/hosts 才可以看到題目 ︿︿
p.s 不同linux version 些許部分不相同但本例是以red hat 考試為主所以,會以redhat做介紹
1.一開始給予一組user password 進入到虛擬機但虛擬機器root 密碼是錯誤所以必須更改
在右下角有開關先重新開機,在倒數時按方向鍵(下)在選單按下e(edit)之後進入候選kernel 同樣按e(edit)在結尾輸入數字1 按enter 後按下b鈕 (boot)此時會進入到文字模式這時候可以更改root password #輸入passwd 之後輸入密碼 完成後init 6 重開即可生效
2.一開始會要求增加軟體源題目會給予ip 位置 example 192.168.0.254
#ca /etc/yum.repos.d 後vi name.repo
i 寫入
[name]
name=xxxx
baseurl=192.168.0.254/pub/os/x86_64 看到repodata資料夾那一層即可
enabled=1
gpgchck=1
gpgkey=尋找該目錄PRM-GPG-KEY 之後存檔離開 (esc :wq)
完成後yum clearn all 即可得分
3.用戶管理
Add user “tom”, ask its home directory is /home/tommy
Add user “mike”, ask its uid is 800, its affiliated groups is “admin “ Add user “selina”,can’t land shell
Passwd :redhat
4 設定密碼均為redhat echo redhat |passwd --stdin [username]
6su – ldapuserX 進入可以看到使用者帳號為成功
在開啟虛擬機之前必須完成實體機器的ip (使用圖型介面即可)設定與hostname vi/etc/hosts 才可以看到題目 ︿︿
p.s 不同linux version 些許部分不相同但本例是以red hat 考試為主所以,會以redhat做介紹
在右下角有開關先重新開機,在倒數時按方向鍵(下)在選單按下e(edit)之後進入候選kernel 同樣按e(edit)在結尾輸入數字1 按enter 後按下b鈕 (boot)此時會進入到文字模式這時候可以更改root password #輸入passwd 之後輸入密碼 完成後init 6 重開即可生效
2.一開始會要求增加軟體源題目會給予ip 位置 example 192.168.0.254
#ca /etc/yum.repos.d 後vi name.repo
i 寫入
[name]
name=xxxx
baseurl=192.168.0.254/pub/os/x86_64 看到repodata資料夾那一層即可
enabled=1
gpgchck=1
gpgkey=尋找該目錄PRM-GPG-KEY 之後存檔離開 (esc :wq)
完成後yum clearn all 即可得分
3.用戶管理
Add user “tom”, ask its home directory is /home/tommy
Add user “mike”, ask its uid is 800, its affiliated groups is “admin “ Add user “selina”,can’t land shell
Passwd :redhat
1 useradd /home/tommy tom
2 useradd -u 800 –G admin mike
3
3useradd -s /sbin/nologin selina
3useradd -s /sbin/nologin selina
4.協同工作
Copy file /etc/passwd to /var/tmp
owners is root , group :admin,the members of admin can write in it
Others without any access
Others without any access
1 cp /etc/passwd /var/tmp
2 chgrp admin passwd
3 chown root:admin passwd
4 chmod 660 passwd
5.目錄權限
Create directory /admin/sales /admin/devel /admin/training
/admin/sales owner is root ,group is admin ,all users in the directory can create documents, but the files and directorys you created automatic for group admin, the owner for founder itself, other users without any access.
/admin/devel owner is root ,group is root , all users in the directory can create documents, but can't delete other files created by the user.
/admin/training the owner is root ,group is root ,user root has all the limits of authority, other users without any access, except user alex can write and read in this directory
1 mkdir /admin cd /admin
2 mkdir {sales, devel ,training}
2 chgrp admin passwd
3 chown root:admin passwd
4 chmod 660 passwd
5.目錄權限
Create directory /admin/sales /admin/devel /admin/training
/admin/sales owner is root ,group is admin ,all users in the directory can create documents, but the files and directorys you created automatic for group admin, the owner for founder itself, other users without any access.
/admin/devel owner is root ,group is root , all users in the directory can create documents, but can't delete other files created by the user.
/admin/training the owner is root ,group is root ,user root has all the limits of authority, other users without any access, except user alex can write and read in this directory
1 mkdir /admin cd /admin
2 mkdir {sales, devel ,training}
3 chgrp sales ;chmod 2770 sales
4 chmod 1777 devel /
5 chmod 770 training
6 setfacl –m u:alex:rwx training/ d:g:admin:rw training }
6核心升級
yum localinstall ip address
7.autonfs
4 chmod 1777 devel /
5 chmod 770 training
6 setfacl –m u:alex:rwx training/ d:g:admin:rw training }
6核心升級
yum localinstall ip address
7.autonfs
1 showmount –e 192.168.0.254 & getent passwd ldapuserX
2vim /etc/auto.mater >>>>設定檔內依題目指示 [xxxx]題目指示 /etc/auto.xxxx [指向位置]
3vim /etc/auto.xxxx ldpauserx ipaddress:所要掛載目錄
4service autofs relaod
5service autofs start
3vim /etc/auto.xxxx ldpauserx ipaddress:所要掛載目錄
4service autofs relaod
5service autofs start
8 網頁伺服器
WEB
Download from the service ftp://192.168.0.254/pub/test/
exam.html Rename index.html
1 yum install httpd 因預設沒安裝所以這邊要自行安裝
Download from the service ftp://192.168.0.254/pub/test/
exam.html Rename index.html
1 yum install httpd 因預設沒安裝所以這邊要自行安裝
2wget ftp://192.168.0.254/pub/test/index.html
3 將檔案複製到/var/www/html
4service httpd restart
5 chkconfig httpd on 開機自動啟用
9. FTP 只有匿名可以登入 一般使用者不可以登入 預設資料夾為 /home/pub
1. yum install vsftpd 因預設沒安裝所以這邊要自行安裝
2. vi/etc/vsftpd/vsftpd.config i 修改設定檔 anonymous_enable=YES anon_root=/home/pub local_enable=NO esc :wq
3 service vsftpd restart 服務重啟
10.NTP 增加時間伺服器
用圖型即可 依題目指示
11.find 將/home 使用者為tom 複製到 /root/find 中
1mkdir -p /root/find
2find /home -user tom -exec cp -a {} /root/find \;
12.swap
Create a swap division ,size 512M, Realize boot automatically mount
1fdisk [device]
2 n 增加 +512M p[列出] t 3[代號] 82 w
3reboot
4mkswap [device] swapon [device]
5vim /etc/fstab
===========================================================
swap swap defaults 0 0
13.
lvm
Create a VG named datastore ,LV named database
VG PE :50 ,size of PE: 16M LV : the number of LE :50
1. yum install vsftpd 因預設沒安裝所以這邊要自行安裝
2. vi/etc/vsftpd/vsftpd.config i 修改設定檔 anonymous_enable=YES anon_root=/home/pub local_enable=NO esc :wq
3 service vsftpd restart 服務重啟
10.NTP 增加時間伺服器
用圖型即可 依題目指示
11.find 將/home 使用者為tom 複製到 /root/find 中
1mkdir -p /root/find
2find /home -user tom -exec cp -a {} /root/find \;
12.swap
Create a swap division ,size 512M, Realize boot automatically mount
1fdisk [device]
2 n 增加 +512M p[列出] t 3[代號] 82 w
3reboot
4mkswap [device] swapon [device]
5vim /etc/fstab
===========================================================
swap swap defaults 0 0
13.
lvm
Create a VG named datastore ,LV named database
VG PE :50 ,size of PE: 16M LV : the number of LE :50
1fdisk [device] p列出 n增加 +816M t 轉為何種格式[device number] 8e w
2reboot
3’pvcreat /dev/sda5
4’vgcreate datastore -s 16M /dev/sda5
5’lvcreate -n database -l 50 /dev/datastore -L(決定size example +200M)
6. mkfs -t [filesystem] [device]
7 寫入 fstab
vi /etc/fstab
=====================================================================
/dev/vgname/lvname [題目指定目錄] defaults 0 0
14.
crontab 分 時 日 月 星期 指令
2reboot
3’pvcreat /dev/sda5
4’vgcreate datastore -s 16M /dev/sda5
5’lvcreate -n database -l 50 /dev/datastore -L(決定size example +200M)
6. mkfs -t [filesystem] [device]
7 寫入 fstab
vi /etc/fstab
=====================================================================
/dev/vgname/lvname [題目指定目錄] defaults 0 0
14.
crontab 分 時 日 月 星期 指令
Linux
昨日與openSUSE Club粉絲團一起討論如何建置owncloud 平台,在這邊先記錄一下,建置過程
本例以openSUSE為例,p.s 不同Linux version Document Root 資料夾位置些許不同
1.進入網頁伺服器目錄下載owncloud 檔案 cd /srv/www/htdocs 後利用wget 指令下載檔案 wget http://owncloud.org/releases/owncloud-3.0.0.tar.bz2
2.對owncloud-3.0.0.tar.bz2解包 tar -jxvf owncloud-3.0.0.tar.bz2 壓縮後會產生owncloud 資料夾
3.對owncloud更改擁有者否則無法正常執行 chown -R wwwrun:www /srv/www/htdocs/owncloud
4.重啟apache 伺服器 /etc/init.d/apache2 restart
5.最後連線第一次連到 http://myip/owncloud 會要求輸入帳號密碼
ps 因預設上傳為512M 若要修改請置 vi /srv/www/htdocs/owncloud/.htaccess 進行修改
本例以openSUSE為例,p.s 不同Linux version Document Root 資料夾位置些許不同
1.進入網頁伺服器目錄下載owncloud 檔案 cd /srv/www/htdocs 後利用wget 指令下載檔案 wget http://owncloud.org/releases/owncloud-3.0.0.tar.bz2
2.對owncloud-3.0.0.tar.bz2解包 tar -jxvf owncloud-3.0.0.tar.bz2 壓縮後會產生owncloud 資料夾
3.對owncloud更改擁有者否則無法正常執行 chown -R wwwrun:www /srv/www/htdocs/owncloud
4.重啟apache 伺服器 /etc/init.d/apache2 restart
5.最後連線第一次連到 http://myip/owncloud 會要求輸入帳號密碼
ps 因預設上傳為512M 若要修改請置 vi /srv/www/htdocs/owncloud/.htaccess 進行修改
訂閱:
文章 (Atom)