Linux系統(tǒng)管理_第1頁
Linux系統(tǒng)管理_第2頁
Linux系統(tǒng)管理_第3頁
Linux系統(tǒng)管理_第4頁
Linux系統(tǒng)管理_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、1 linux 系統(tǒng)管理實驗目的1.掌握用戶和組的概念、配置文件和常用命令;2.掌握常用軟件包的管理方法。二、實驗環(huán)境計算機一臺,內存1gb ,且安裝有 vmware workstation 7 ,pa 在虛擬機中安裝red hat enterprise linux 5 server。三、實驗內容(一)用戶和組管理1使用命令創(chuàng)建用戶賬戶zhangsan ,并設置其口令為111111 ,設置用戶名全稱為張三,辦公室電話為57111111 ;rootlocalhost # useradd zhangsan rootlocalhost # cat /etc/passwd |grep zhangsan

2、 zhangsan:x:503:503:/home/zhangsan:/bin/bash rootlocalhost # passwd zhangsan changing password for user zhangsan. new unix password: bad password: it does not contain enough different characters retype new unix password: passwd: all authentication tokens updated successfully. rootlocalhost # chfn zh

3、angsan changing finger information for zhangsan. name : 張三office : office phone : 57111111 home phone : finger information changed. rootlocalhost # finger zhangsan login: zhangsan name: 張三directory: /home/zhangsan shell: /bin/bash office: 57111111 2 never logged in. no mail. no plan. 2使用命令修改用戶賬戶zhan

4、gsan的 uid 為 700,其 shell 類型為 /bin/ksh;rootlocalhost # cat /etc/passwd|grep zhangsan zhangsan:x:503:503: 張三,57111111:/home/zhangsan:/bin/bash rootlocalhost # usermod -u 700 zhangsan rootlocalhost # usermod -s /bin/ksh zhangsan rootlocalhost # cat /etc/passwd|grep zhangsan zhangsan:x:700:503: 張三,571111

5、11:/home/zhangsan:/bin/ksh 3使用命令刪除用戶賬戶zhangsan ,并且在刪除該用戶的同時一起刪除其主目錄;rootlocalhost # ls /home webadmin yingcao zhangsan rootlocalhost # userdel -r zhangsan rootlocalhost # ls /home webadmin yingcao 4使用命令創(chuàng)建組群group1,并且在創(chuàng)建時設置其gid 為 800;rootlocalhost # groupadd -g 800 group1 rootlocalhost # cat /etc/grou

6、p |grep group1 group1:x:800: 5使用命令修改組群group1 的新組群名稱為newgroup,設置組群 group1 的口令為 222222。rootlocalhost # cat /etc/group |grep group1 group1:x:800: rootlocalhost # groupmod -n newgroup group1 rootlocalhost # cat /etc/group |grep newgroup newgroup:x:800: rootlocalhost # gpasswd newgroup 正在修改newgroup 組的密碼3

7、 新密碼:請重新輸入新密碼:(二)軟件包管理1查詢了解當前系統(tǒng)所安裝的軟件包程序;rpm qa 顯示了很多信息2查詢顯示當前所安裝的軟件包名中包含 tel 關鍵字的軟件包;rootlocalhost # rpm -qa|grep tel telnet-0.17-39.el5 3查詢已安裝的 telnet-0.17-39軟件包所包含的文件及其安裝位置;rootlocalhost # rpm -ql telnet-0.17-39.el5 /usr/bin/telnet /usr/share/man/man1/telnet.1.gz 4查詢當前系統(tǒng)是否安裝telnet-server服務器軟件包;rp

8、m -q telnet-server package telnet-server is not installed 5若沒有安裝,則安裝telnet-server-0.17-38.el5.i386.rpm 軟件包,然后查詢telnet-server軟件包安裝是否成功;rootlocalhost # mkdir /media/cdrom rootlocalhost # mount -t iso9660 /dev/hda /media/cdrom mount: block device /dev/hda is write-protected, mounting read-only rootloca

9、lhost # cd /media/cdrom rootlocalhost cdrom# ls readme-kn.html release-notes-hi.html release-notes-u5-gu.html server rootlocalhost cdrom# cd server rootlocalhost server# ls | grep telnet telnet-0.17-39.el5.i386.rpm telnet-server-0.17-39.el5.i386.rpm 4 rootlocalhost server# rpm -ivh telnet-server-0.1

10、7-39.el5.i386.rpm warning: telnet-server-0.17-39.el5.i386.rpm: header v3 dsa signature: nokey , key id 37017186 preparing. # 100% 1:telnet-server # 100% rootlocalhost server# rpm -q telnet-server telnet-server-0.17-39.el5 6在 windows 系統(tǒng)的命令行狀態(tài)下,使用“telnet linux 主機 ip 地址”命令格式,登錄 linux 主機,以測試能否利用telnet 服

11、務器進行遠程登錄和訪問linux主機;安裝成功后,啟動telnet 服務,并在防火墻設置中將telnet 添加為信任服務;rootlocalhost server# chkconfig telnet on/啟動 telnet服務要求:為小組內每個成員分配一個用戶名和口令,方便以后實驗。rootlocalhost # telnet 192.168.80.182 trying 192.168.80.182. connected to 192.168.80.182 (192.168.80.182). escape character is . red hat enterprise linux ser

12、ver release 5.5 (tikanga) kernel 2.6.18-194.el5xen on an i686 login: teacher password: teacherlocalhost $ 7將整個 /etc目錄打包并壓縮成myetc.tar.gz文件,并保存在 /root 目錄中;rootlocalhost # tar zcf myetc.tar.gz /etc tar: 從成員名中刪除開頭的“/”tar: 從硬連接目標中刪除開頭的“/”rootlocalhost # find / -name myetc.tar.gz /root/myetc.tar.gz 5 8將整個

13、 /etc 目錄的文件列表保存到 /root/myfile.txt 文件中,然后將該文件打包壓縮成 myfile.txt.tar.bz2;rootlocalhost # ls -a /etc myfile.txt rootlocalhost # cat myfile.txt . . a2ps.cfg a2ps-site.cfg( 顯示很多只粘貼了部分 ) rootlocalhost # tar jcf myfile.txt.tar.bz2 myfile.txt tar: 從成員名中刪除開頭的“/”rootlocalhost # find -name myfile.txt.tar.bz2 ./myfile.txt.tar.bz2 9刪除 myfile.txt 文件;rootlocalhost # rm /root/myfile

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論