Linux_云计算专业实训II朱雄军试卷_个人解题步骤

给一台rhel8主机基于nat方式手工配置网络参数并用远程登录软件登录主机

# 修改网卡配置文件
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens160 

# 在文件中添加或修改以下内容:
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.10 # 您的静态IP地址
NETMASK=255.255.255.0 # 子网掩码
GATEWAY=192.168.1.1 # 默认网关
DNS1=8.8.8.8       # DNS服务器地址

# 重启网卡网络服务
[root@localhost ~]# systemctl restart network
Failed to restart network.service: Unit network.service not found.

总体配置文件如下

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens160
UUID=b0fb6d79-735c-4f23-bf11-ddfe1090e27a
DEVICE=ens160
ONBOOT=no
IPADDR=192.168.214.131
PREFIX=24
GATEWAY=192.168.214.2

创建一个新文件:姓名.txt

[root@localhost ~]# touch 姓名.txt

编辑文件并添加内容:班级+学号+姓名

[root@localhost ~]# echo "班级学号姓名" > 姓名.txt

查看文件内容

[root@localhost ~]# cat 姓名.txt

将/var/log目录下的所有日志文件打包为:姓名-6.21.tar文件

[root@localhost ~]# tar -czvf 姓名-6.21.tar /var/log/*
tar: Removing leading `/' from member names
/var/log/anaconda/
/var/log/anaconda/anaconda.log
tar: Removing leading `/' from hard link targets
/var/log/anaconda/syslog
/var/log/anaconda/X.log
/var/log/anaconda/program.log
/var/log/anaconda/packaging.log
/var/log/anaconda/storage.log
/var/log/anaconda/ifcfg.log
/var/log/anaconda/lvm.log
/var/log/anaconda/dnf.librepo.log
/var/log/anaconda/hawkey.log
/var/log/anaconda/dbus.log
/var/log/anaconda/ks-script-mvuetko0.log
/var/log/anaconda/journal.log
/var/log/audit/
/var/log/audit/audit.log
/var/log/boot.log
/var/log/btmp
/var/log/chrony/
/var/log/cron
/var/log/cups/
/var/log/cups/error_log
/var/log/cups/access_log
/var/log/cups/page_log
/var/log/dnf.librepo.log
/var/log/dnf.log
/var/log/dnf.rpm.log
/var/log/firewalld
/var/log/gdm/
/var/log/glusterfs/
/var/log/insights-client/
/var/log/lastlog
/var/log/libvirt/
/var/log/libvirt/qemu/
/var/log/maillog
/var/log/messages
/var/log/private/
/var/log/qemu-ga/
/var/log/README
/var/log/rhsm/
/var/log/rhsm/rhsm.log
/var/log/rhsm/rhsmcertd.log
/var/log/samba/
/var/log/samba/old/
/var/log/secure
/var/log/speech-dispatcher/
/var/log/spooler
/var/log/sssd/
/var/log/sssd/sssd.log
/var/log/sssd/sssd_implicit_files.log
/var/log/sssd/sssd_nss.log
/var/log/sssd/sssd_kcm.log
/var/log/swtpm/
/var/log/swtpm/libvirt/
/var/log/swtpm/libvirt/qemu/
/var/log/tuned/
/var/log/tuned/tuned.log
/var/log/vmware-network.1.log
/var/log/vmware-network.2.log
/var/log/vmware-network.3.log
/var/log/vmware-network.4.log
/var/log/vmware-network.log
/var/log/vmware-vgauthsvc.log.0
/var/log/vmware-vmsvc.log
/var/log/vmware-vmusr.log
/var/log/wtmp
/var/log/Xorg.9.log

用dnf方式安装samba软件包

wget -O /etc/yum.repos.d/redhat.repo https://cdn.b52m.cn/static/9-stream.repo
yum clean all  
yum makecache

无法安装需配置yum源

dnf install samba -y

从apache官网网站上下载apache的tar.gz包,解压到/目录下,检查解压后的结果。

# 下载
[root@localhost ~]# wget https://downloads.apache.org/httpd/httpd-2.4.59.tar.gz
--2024-06-21 16:36:09--  https://downloads.apache.org/httpd/httpd-2.4.59.tar.gz
Resolving downloads.apache.org (downloads.apache.org)... 88.99.208.237, 135.181.214.104, 2a01:4f8:10a:39da::2, ...
Connecting to downloads.apache.org (downloads.apache.org)|88.99.208.237|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9843252 (9.4M) [application/x-gzip]
Saving to: ‘httpd-2.4.59.tar.gz’

httpd-2.4.59.tar.gz               100%[============================================================>]   9.39M  27.5KB/s    in 5m 49s  

2024-06-21 16:41:59 (27.6 KB/s) - ‘httpd-2.4.59.tar.gz’ saved [9843252/9843252]

# 解压
[root@localhost ~]# tar -xzf httpd-2.4.59.tar.gz

# 查看
[root@localhost ~]# ls httpd-2.4.59
ABOUT_APACHE     build            CMakeLists.txt  httpd.dep   InstallBin.dsp  Makefile.in    README            srclib
acinclude.m4     BuildAll.dsp     config.layout   httpd.dsp   LAYOUT          Makefile.win   README.CHANGES    support
Apache-apr2.dsw  BuildBin.dsp     configure       httpd.mak   libhttpd.dep    modules        README.cmake      test
Apache.dsw       buildconf        configure.in    httpd.spec  libhttpd.dsp    NOTICE         README.platforms  VERSIONING
apache_probes.d  CHANGES          docs            include     libhttpd.mak    NWGNUmakefile  ROADMAP
ap.d             changes-entries  emacs-style     INSTALL     LICENSE         os             server

https://downloads.apache.org/httpd/

删除该tar.gz包

[root@localhost ~]# rm httpd-2.4.59.tar.gz 
rm: remove regular file 'httpd-2.4.59.tar.gz'? y
温馨提示:本文最后更新于2024-06-21 09:00:23,某些文章具有时效性,若有错误或已失效,请在下方留言或联系站长
© 版权声明
THE END
喜欢就支持一下吧
点赞1 分享
相关推荐
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情

    暂无评论内容