RHCE(1)

1、指定在每天凌晨4:00将该时间点之前的系统日志信息(/var/log/messages )备份到目录下/backup,备份后日志文件名显示格式logfileYY-MM-DD-HH-MM

[root@localhost ~]# mkdir /backup
[root@localhost ~]# crontab -e
no crontab for root - using an empty one
'''
00 04 * * * cp -a /var/log/cron /var/log/messages/cron'date + (%Y-%M-%D %H:%M).log
~
~
~
~
~
~
~
~
~

2、配置ssh免密登陆:客户端主机通过redhat用户基于秘钥验证方式进行远程连接服务器的root用户。

客户端
[root@localhost ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:ZBQJ7JlhZDXPbKbnisOwuaCnuF/UwUrNMsA414EM5Wk root@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
|.*oo.++o=o       |
|o.=o.=+..=       |
| oE +o=+o *      |
[root@localhost ~]# ll /root/.ssh
总用量 8
-rw-------. 1 root root 2610 11月 21 20:39 id_rsa
-rw-r--r--. 1 root root  580 11月 21 20:39 id_rsa.pub
[root@localhost ~]# ssh-copy-id 192.168.53.212
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: ssh: connect to host 192.168.53.212 port 22: Connection refused

3、搭建一个web网站,网站显示hello world内容

[root@localhost ~]# ll  /etc/yum.repos.d/
总用量 4
-rw-r--r--. 1 root root 358 11月 21 20:39 redhat.repo
[root@localhost ~]# vim /etc/yum.repos.d/aliyun.repo
[root@localhost ~]# yum   install   httpd -y
正在更新 Subscription Management 软件仓库。
无法读取客户身份

本系统尚未在权利服务器中注册。可使用 subscription-manager 进行注册。

aliyun-base                                         3.2 MB/s | 7.9 MB     00:02
aliyun-app                                          5.2 MB/s |  18 MB     00:03
上次元数据过期检查:0:00:01 前,执行于 2023年11月21日 星期二 20时48分17秒。
依赖关系解决。

  • 11
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晚风替我看朝夕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值