博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
chapter02 - 03 作业
阅读量:5311 次
发布时间:2019-06-14

本文共 18397 字,大约阅读时间需要 61 分钟。

1、分别用cat \tac\nl三个命令查看文件/etc/ssh/sshd_config文件中的内容,并用自己的话总计出这三个文档操作命令的不同之处?

[root@localhost ~]# cat /etc/ssh/sshd_config  正向显示文件能容

# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $

 

# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.

 

# This sshd was compiled with PATH=/usr/local/bin:/usr/bin

 

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options override the

# default value.

 

[root@localhost ~]# tac /etc/ssh/sshd_config  反向显示文件能容

# ForceCommand cvs server

# PermitTTY no

# AllowTcpForwarding no

# X11Forwarding no

#Match User anoncvs

# Example of overriding settings on a per-user basis

 

Subsystem sftp /usr/libexec/openssh/sftp-server

# override default of no subsystems

 

AcceptEnv XMODIFIERS

AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE

AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT

AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES

# Accept locale-related environment variables

 

 

[root@localhost ~]# nl  /etc/ssh/sshd_config   正向显示并显示行号,(空格不计算行号)

     1 # $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $

       

     2 # This is the sshd server system-wide configuration file.  See

     3 # sshd_config(5) for more information.

       

     4 # This sshd was compiled with PATH=/usr/local/bin:/usr/bin

       

     5 # The strategy used for options in the default sshd_config shipped with

     6 # OpenSSH is to specify options with their default value where

     7 # possible, but leave them commented.  Uncommented options override the

     8 # default value.

       

     9 # If you want to change the port on a SELinux system, you have to tell

    10 # SELinux about this change.

注:cat -n 显示行号包括空格

2、分别用moreless查看/etc/ssh/sshd_config里面的内容,请用总结moreless两个命令的相同和不同之处?

[root@localhost ~]# more /etc/ssh/sshd_config 回车向下一行,空格向下翻一页 q退出

# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $

 

# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.

 

# This sshd was compiled with PATH=/usr/local/bin:/usr/bin

 

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options override the

# default value.

 

# If you want to change the port on a SELinux system, you have to tell

# SELinux about this change.

# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER

 

[root@localhost ~]# less /etc/ssh/sshd_config  回车向下一行,pgup向上一行,pgdn向下一行  /搜索 N查找上一个 n查找下一个 空格向下一页

#       $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $

 

# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.

 

# This sshd was compiled with PATH=/usr/local/bin:/usr/bin

 

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options override the

# default value.

 

3、/etc/passwd文件中的前20行重定向保存到/root下改名为20_pass.txt,/etc/passwd文件中的后15行重定向保存到/root下改名为:pass_15.txt

[root@localhost ~]# head -20 /etc/passwd > /root/20_pass.txt

[root@localhost ~]# ls /root

20_pass.txt  anaconda-ks.cfg  wangbaoxin  yunjisuan  yun.tar.bz2  公共  模板  视频  图片  文档  下载  音乐  桌面

 

[root@localhost ~]# tail -15 /etc/passwd > /root/pass_15.txt

[root@localhost ~]# ls /root/

20_pass.txt  anaconda-ks.cfg  pass_15.txt  wangbaoxin  yunjisuan  yun.tar.bz2  公共  模板  视频  图片  文档  下载  音乐  桌面

[root@localhost ~]#

4、请用一个命令统计/etc/hosts文件包含有多少行?多少字节?多少单词数?

[root@localhost ~]# wc -lwc /etc/hosts   l行数 w单词数  c字节

  2  10 158 /etc/hosts

 /etc/hosts 共有210个单词  158字节

5、练习使用grepegrep

5.1.通过grep管道工具过滤出ifconfig命令显示信息中的IP字段?

[root@localhost ~]# ifconfig | grep -o "inet [0-9.]*"  | head -1

inet 192.168.100.102

5.2./etc/passwd文件中的前20行重定向保存到/root下名称为pass

[root@localhost ~]# head -20 /etc/passwd > /root/pass

[root@localhost ~]# ls /root/

20_pass.txt  anaconda-ks.cfg  pass  pass_15.txt  wangbaoxin  yunjisuan  yun.tar.bz2  公共  模板  视频  图片  文档  下载  音乐  桌面共  模板  视频  图片  文档  下载  音乐  桌面

5.3.过滤/etc/passwd文件中含有/sbin/nologin 的行并统计行数?

[root@localhost ~]#  grep "/sbin/nologin" /etc/passwd

bin:x:1:1:bin:/bin:/sbin/nologin

daemon:x:2:2:daemon:/sbin:/sbin/nologin

adm:x:3:4:adm:/var/adm:/sbin/nologin

lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

mail:x:8:12:mail:/var/spool/mail:/sbin/nologin

operator:x:11:0:operator:/root:/sbin/nologin

games:x:12:100:games:/usr/games:/sbin/nologin

ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

nobody:x:99:99:Nobody:/:/sbin/nologin

dbus:x:81:81:System message bus:/:/sbin/nologin

polkitd:x:999:999:User for polkitd:/:/sbin/nologin

tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin

usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin

colord:x:998:997:User for colord:/var/lib/colord:/sbin/nologin

ntp:x:38:38::/etc/ntp:/sbin/nologin

libstoragemgmt:x:997:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin

saslauth:x:996:76:"Saslauthd user":/run/saslauthd:/sbin/nologin

rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin

rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin

radvd:x:75:75:radvd user:/:/sbin/nologin

rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin

nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

qemu:x:107:107:qemu user:/:/sbin/nologin

chrony:x:995:994::/var/lib/chrony:/sbin/nologin

abrt:x:173:173::/etc/abrt:/sbin/nologin

sssd:x:994:993:User for sssd:/:/sbin/nologin

avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin

unbound:x:993:992:Unbound DNS resolver:/etc/unbound:/sbin/nologin

pulse:x:171:171:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin

gdm:x:42:42::/var/lib/gdm:/sbin/nologin

gnome-initial-setup:x:992:990::/run/gnome-initial-setup/:/sbin/nologin

postfix:x:89:89::/var/spool/postfix:/sbin/nologin

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin

tcpdump:x:72:72::/:/sbin/nologin

[root@localhost ~]#  grep "/sbin/nologin" /etc/passwd | wc -l

35

5.4 过滤/etc/passwd文件中以sh结尾的行,及以 root开头的行,不显示包含login的行?

[root@localhost ~]# grep "sh$" /etc/passwd | grep "^root" | grep -v "login"

root:x:0:0:root:/root:/bin/bash

 

5.5 分别用grepegrep过滤出/etc/ssh/sshd_config文件中不包含“#”开头和空白的行?

[root@localhost ~]# egrep -v "^#|^$" /etc/ssh/sshd_config

HostKey /etc/ssh/ssh_host_rsa_key

HostKey /etc/ssh/ssh_host_ecdsa_key

HostKey /etc/ssh/ssh_host_ed25519_key

SyslogFacility AUTHPRIV

 

[root@localhost ~]# grep -v "^#" /etc/ssh/sshd_config | grep -v "^$"

HostKey /etc/ssh/ssh_host_rsa_key

HostKey /etc/ssh/ssh_host_ecdsa_key

HostKey /etc/ssh/ssh_host_ed25519_key

SyslogFacility AUTHPRIV

6.1 通过tar命令将/etc/passwd文件打包压缩成/root/file.tar.gz

[root@localhost ~]# tar cvzf /root/file.tar.gz /etc/passwd

tar: 从成员名中删除开头的“/

/etc/passwd

[root@localhost ~]# ls /root/

20_pass.txt      file.tar.gz  pass_15.txt  yunjisuan    公共  视频  文档  音乐

anaconda-ks.cfg  pass         wangbaoxin   yun.tar.bz2  模板  图片  下载  桌面

6.2通过tar命令将/etc/passwd文件打包压缩成/root/file.tar.bz2

[root@localhost ~]# tar vcfj /root/file.tar.bz2  /etc/passwd

tar: 从成员名中删除开头的“/

/etc/passwd

[root@localhost ~]# ls /root/

20_pass.txt      file.tar.bz2  pass         wangbaoxin  yun.tar.bz2  模板  图片  下载  桌面

anaconda-ks.cfg  file.tar.gz   pass_15.txt  yunjisuan   公共         视频  文档  音乐

 

6.3创建空文件夹/web/test1,并将file.tar.bz2 解包并释放到/web/test1目录下?

[root@localhost ~]# tar xfj file.tar.bz2 -C /web/test1/

[root@localhost ~]# ls /web/test1/

etc

[root@localhost ~]# ls -R /web/test1/

/web/test1/:

etc

/web/test1/etc:

passwd

 

7.1 通过vi编辑/web/test1/passwd文件将文件里为root单词全部替换成benet

[root@localhost ~]# cd /web/test1/etc/

[root@localhost etc]# vi passwd

:% s/root/benet/g

[root@localhost etc]# vi passwd

benet:x:0:0:benet:/benet:/bin/bash

bin:x:1:1:bin:/bin:/sbin/nologin

daemon:x:2:2:daemon:/sbin:/sbin/nologin

adm:x:3:4:adm:/var/adm:/sbin/nologin

lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

sync:x:5:0:sync:/sbin:/bin/sync

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

halt:x:7:0:halt:/sbin:/sbin/halt

mail:x:8:12:mail:/var/spool/mail:/sbin/nologin

operator:x:11:0:operator:/benet:/sbin/nologin

games:x:12:100:games:/usr/games:/sbin/nologin

ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

nobody:x:99:99:Nobody:/:/sbin/nologin

dbus:x:81:81:System message bus:/:/sbin/nologin

polkitd:x:999:999:User for polkitd:/:/sbin/nologin

tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin

usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin

colord:x:998:997:User for colord:/var/lib/colord:/sbin/nologin

ntp:x:38:38::/etc/ntp:/sbin/nologin

libstoragemgmt:x:997:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin

saslauth:x:996:76:"Saslauthd user":/run/saslauthd:/sbin/nologin

rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin

rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin

radvd:x:75:75:radvd user:/:/sbin/nologin

rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin

nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

qemu:x:107:107:qemu user:/:/sbin/nologin

chrony:x:995:994::/var/lib/chrony:/sbin/nologin

abrt:x:173:173::/etc/abrt:/sbin/nologin

sssd:x:994:993:User for sssd:/:/sbin/nologin

avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin

unbound:x:993:992:Unbound DNS resolver:/etc/unbound:/sbin/nologin

pulse:x:171:171:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin

gdm:x:42:42::/var/lib/gdm:/sbin/nologin

gnome-initial-setup:x:992:990::/run/gnome-initial-setup/:/sbin/nologin

postfix:x:89:89::/var/spool/postfix:/sbin/nologin

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

E486: Pattern not found: root

7.2 通过vi编辑 删除pass文件第1510行。

:set nu 显示行号 将光标定位到1510 dd删除

7.3 vi中显示pass文件行号复制文件2 3 4行粘贴到以lp开头的行下。

:set nu 显示行号 将光标定位到第二行 3yy 复制234当前3三行 /lp 回车 p粘贴(未改变pass基础实现

7.4 通过vi编辑 查找文件内包含mail var等字符串,并记录所在行号。

:set nu 显示行号 /mail 9行  /var 459121820(未改变pass基础实现)

7.5 通过vi编辑 快速跳转到文件的第二行,通过r 读取 /etc/hosts 文件的内容到第二行下。

2  shift+g 定位到第二行   切入末行模式 :r /etc/hosts

1 root:x:0:0:root:/root:/bin/bash

2 bin:x:1:1:bin:/bin:/sbin/nologin

3 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

4 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

5 daemon:x:2:2:daemon:/sbin:/sbin/nologin

7.6将更改后的文件使用vim另存为/root/new_pass

进入末行模式: w  /root/new_pass

# ls

20_pass.txt      file.tar.bz2  new_pass  pass_15.txt  yunjisuan    公共  视频  文档  音乐

anaconda-ks.cfg  file.tar.gz   pass      wangbaoxin   yun.tar.bz2  模板  图片  下载  桌面

7.7new_pass文件压缩成gz格式并改名为npass.gz文件。

[root@localhost ~]# gzip new_pass |mv new_pass.gz npass.gz

mv: 无法获取"new_pass.gz" 的文件状态(stat): 没有那个文件或目录

[root@localhost ~]# gzip new_pass |mv new_pass.gz npass.gz

gzip: new_pass: No such file or directory

[root@localhost ~]# ls

anaconda-ks.cfg  npass.gz  公共  模板  视频  图片  文档  下载  音乐  桌面

8统计/dev 目录下的文件数量。   

[root@localhost ~]# ls -la /dev/ | grep -v "^d" | wc -l

142

9.1/boot下查找文件名以vmlinuz开头的文件?

[root@localhost ~]# find /boot/ -name vmlinuz*

/boot/vmlinuz-3.10.0-229.el7.x86_64

/boot/vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

[root@localhost ~]# ls /boot/ | grep "^vmlinuz"

vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

vmlinuz-3.10.0-229.el7.x86_64

9.2/boot下查找文件大小大于3M 小于 20M 的文件

[root@localhost ~]# find /boot/ -size +1M -a -size -4M

/boot/grub2/fonts/unicode.pf2

/boot/System.map-3.10.0-229.el7.x86_64

 

10 请详细写出构建本地yum仓库的步骤?并在每行命令后面用自己的话做上中文注释?

[root@localhost ~]# umount /dev/sr0   //卸载光驱

[root@localhost ~]# mount /dev/sr0 /media/   //重新挂载光驱

mount: /dev/sr0 写保护,将以只读方式挂载

[root@localhost ~]# cd /etc/yum.r*  //进入yum.r*目录

//删除以前建立内容

[root@localhost yum.repos.d]# ls

a  local1.repo

[root@localhost yum.repos.d]# rm local1.repo

rm:是否删除普通文件 "local1.repo"y

[root@localhost yum.repos.d]# mv a/C* ./

[root@localhost yum.repos.d]# ls

a  CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Sources.repo  CentOS-Vault.repo

[root@localhost yum.repos.d]# rm -fr a

[root@localhost yum.repos.d]# ls

CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Sources.repo  CentOS-Vault.repo

[root@localhost yum.repos.d]# mkdir a //创建a目录

[root@localhost yum.repos.d]# ls

a  CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Sources.repo  CentOS-Vault.repo

[root@localhost yum.repos.d]# mv C* a/  //将所有C开头的文件剪切到a目录中

[root@localhost yum.repos.d]# ls

a

[root@localhost yum.repos.d]# vi aaa.repo  //创建aaa.repo文件

[cdrom]

name=cdrom             //yum仓库名cdrom

baseurl=file:///media      //rpm包路径

enabled=1               //启动本地yum仓库

gpgcheck=0            //gpg校验关闭

 

[root@localhost yum.repos.d]# yum -y clean all   //清除yum缓存

已加载插件:fastestmirror, langpacks

正在清理软件源: cdrom

Cleaning up everything

Cleaning up list of fastest mirrors

[root@localhost yum.repos.d]# yum makecache  //重建yum缓存

已加载插件:fastestmirror, langpacks

cdrom                                                                                                                    | 3.6 kB  00:00:00     

(1/4): cdrom/group_gz                                                                                                    | 154 kB  00:00:02     

(2/4): cdrom/filelists_db                                                                                                | 2.7 MB  00:00:03     

(3/4): cdrom/primary_db                                                                                                  | 2.7 MB  00:00:01     

(4/4): cdrom/other_db                                                                                                    | 1.1 MB  00:00:00     

Determining fastest mirrors

元数据缓存已建立

[root@localhost yum.repos.d]# yum -y install vsftpd     //安装vsftpd软件

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 vsftpd.x86_64.0.3.0.2-9.el7 将被 安装

--> 解决依赖关系完成

 

依赖关系解决

 

================================================================================================================================================

 Package                          架构                             版本                                   源                               大小

================================================================================================================================================

正在安装:

 vsftpd                           x86_64                           3.0.2-9.el7                            cdrom                           165 k

 

事务概要

================================================================================================================================================

安装  1 软件包

 

总下载量:165 k

安装大小:343 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

  验证中      : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

 

已安装:

  vsftpd.x86_64 0:3.0.2-9.el7                                                                                                                   

 

完毕!

[root@localhost yum.repos.d]# rpm -q vsftpd    //查看vsftpd软件安装情况

vsftpd-3.0.2-9.el7.x86_64

[root@localhost yum.repos.d]# yum -y remove vsftpd   //卸载vsftpd软件

已加载插件:fastestmirror, langpacks

正在解决依赖关系

--> 正在检查事务

---> 软件包 vsftpd.x86_64.0.3.0.2-9.el7 将被 删除

--> 解决依赖关系完成

 

依赖关系解决

 

================================================================================================================================================

 Package                          架构                             版本                                  源                                大小

================================================================================================================================================

正在删除:

 vsftpd                           x86_64                           3.0.2-9.el7                           @cdrom                           343 k

 

事务概要

================================================================================================================================================

移除  1 软件包

 

安装大小:343 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在删除    : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

  验证中      : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

 

删除:

  vsftpd.x86_64 0:3.0.2-9.el7                                                                                                                   

 

完毕!

[root@localhost yum.repos.d]# rpm -q vsftpd    //查看vsftpd卸载情况

未安装软件包 vsftpd

11、用yum命令安装vsftpd,查询安装情况,最后卸载vsftpd,并再次查询卸载情况?

[root@localhost yum.repos.d]# yum -y install vsftpd     //安装vsftpd软件

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 vsftpd.x86_64.0.3.0.2-9.el7 将被 安装

--> 解决依赖关系完成

 

依赖关系解决

 

================================================================================================================================================

 Package                          架构                             版本                                   源                               大小

================================================================================================================================================

正在安装:

 vsftpd                           x86_64                           3.0.2-9.el7                            cdrom                           165 k

 

事务概要

================================================================================================================================================

安装  1 软件包

 

总下载量:165 k

安装大小:343 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

  验证中      : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

 

已安装:

  vsftpd.x86_64 0:3.0.2-9.el7                                                                                                                   

 

完毕!

[root@localhost yum.repos.d]# rpm -q vsftpd    //查看vsftpd软件安装情况

vsftpd-3.0.2-9.el7.x86_64

[root@localhost yum.repos.d]# yum -y remove vsftpd   //卸载vsftpd软件

已加载插件:fastestmirror, langpacks

正在解决依赖关系

--> 正在检查事务

---> 软件包 vsftpd.x86_64.0.3.0.2-9.el7 将被 删除

--> 解决依赖关系完成

 

依赖关系解决

 

================================================================================================================================================

 Package                          架构                             版本                                  源                                大小

================================================================================================================================================

正在删除:

 vsftpd                           x86_64                           3.0.2-9.el7                           @cdrom                           343 k

 

事务概要

================================================================================================================================================

移除  1 软件包

 

安装大小:343 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在删除    : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

  验证中      : vsftpd-3.0.2-9.el7.x86_64                                                                                                   1/1

 

删除:

  vsftpd.x86_64 0:3.0.2-9.el7                                                                                                                   

 

完毕!

[root@localhost yum.repos.d]# rpm -q vsftpd    //查看vsftpd卸载情况

未安装软件包 vsftpd

 

12、用rpm命令安装vsftpd,查询安装情况,最后卸载vsftpd,并再次查询卸载情况?

[root@localhost ~]# umount /media/     //清除挂载

[root@localhost ~]# ls /media/

[root@localhost ~]# mount /dev/sr0 /media/  //重新挂载sr0

mount: /dev/sr0 写保护,将以只读方式挂载

[root@localhost ~]# cd /media/Packages/  //进入/media/Packages/

[root@localhost Packages]# rpm -q vsftpd  //查看软件安装情况

未安装软件包 vsftpd

[root@localhost Packages]# rpm -ivh vsftpd-3.0.2-9.el7.x86_64.rpm  //安装软件  

警告:vsftpd-3.0.2-9.el7.x86_64.rpm: V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY

准备中...                          ################################# [100%]

正在升级/安装...

   1:vsftpd-3.0.2-9.el7               ################################# [100%]

[root@localhost Packages]# rpm -q vsftpd  //查看软件安装情况

vsftpd-3.0.2-9.el7.x86_64

[root@localhost Packages]# rpm -e vsftpd   //卸载软件

[root@localhost Packages]# rpm -q vsftpd  //查看软件卸载情况

未安装软件包 vsftpd

13、通过源码方式通过解包、配置、编译、安装四个步骤安装源码软件httpd-2.2.17.tar.gz?并进行测试?

1、将软件包导入

2、查看gcc、gcc-c++、make是否安装,没安装安装(建议yum安装)
gcc --version
3、将源码包解压到/usr/src/目录下
tar -xf 包名 /usr/src/
4、配置源码,指定安装目录
进入源码包名目录下
./configgure -- prefix=/usr/local/apache
5、编译(源码包目录下)
make
6、安装(源码包目录下)
make install
7、修改配置文件
cd /usr/local/apache/conf
vi 包名.conf 文件
将ServerName 打开
8、启动Apache
/usr/local/apache/bin/apachectl start

9、运行lynx

lynx 127.0.0.1
没有安装lynx

转载于:https://www.cnblogs.com/fengling1998/p/11249826.html

你可能感兴趣的文章
ajax连接服务器框架
查看>>
wpf样式绑定 行为绑定 事件关联 路由事件实例
查看>>
利用maven管理项目之POM文件配置
查看>>
TCL:表格(xls)中写入数据
查看>>
Oracle事务
查看>>
String类中的equals方法总结(转载)
查看>>
属性动画
查看>>
标识符
查看>>
给大家分享一张CSS选择器优选级图谱 !
查看>>
Win7中不能调试windows service
查看>>
通过httplib2 探索的学习的最佳方式
查看>>
快来熟练使用 Mac 编程
查看>>
Node.js 入门:Express + Mongoose 基础使用
查看>>
一步步教你轻松学奇异值分解SVD降维算法
查看>>
使用pager进行分页
查看>>
UVA - 1592 Database
查看>>
Fine Uploader文件上传组件
查看>>
javascript中的传递参数
查看>>
objective-c overview(二)
查看>>
python查询mangodb
查看>>