CE第六次作业

第一题(两台主机)
内网
[root@localhost ~]# vim /etc/named.conf
options {
listen-on port 53 { 192.168.153.132; };
directory “/var/named”;
allow-query { any; };

};
acl"china"{192.168.153.132; };
acl"vmware"{192.168.153.135; };

view "china"{
     match-clients { "china"; };
    zone "openlab.com" IN {
            type master;
            file "named.openlab.com";
            notify yes;
    };

};
view “vmware” {
match-clients { “vmware”; };
zone “openlab.com” IN {
type master;
file “named.openlab1.com”;
};
};
[root@localhost ~]# vim /var/named/named.openlab.com
$TTL 1D
@ IN SOA @ admin.admin.com. (
2021070213
1D
1D
1D
1D )
IN NS dns.openlab.com.
dns IN A 10.211.55.11
haha IN A 10.211.55.11
xixi IN A 10.211.55.11
www IN A 192.168.153.100
[root@localhost ~]# vim /var/named/named.openlab1.com
$TTL 1D
@ IN SOA @ admin.admin.com. (
2021071501
1D
1D
1D
1D )
IN NS dns.openlab.com.
dns IN A 10.211.55.113
haha IN A 10.211.55.112
xixi IN A 10.211.55.111
www IN A 192.168.153.200

测试
内网
[root@localhost ~]# nslookup

server 192.168.153.132
Default server: 192.168.153.132
Address: 192.168.153.132#53
www.openlab.com
Server: 192.168.153.132
Address: 192.168.153.132#53

Name: www.openlab.com
Address: 192.168.153.100
外网
[root@localhost ~]# nslookup

server 192.168.153.132
Default server: 192.168.153.132
Address: 192.168.153.132#53
www.openlab.com
Server: 192.168.153.132
Address: 192.168.153.132#53

Name: www.openlab.com
Address: 192.168.153.200

第二题
A
[root@localhost ~]# ssh-keygen -t RSA
[root@localhost ~]# ll /root/.ssh
total 8
-rw-------. 1 root root 2610 Jul 15 19:39 id_rsa(私钥)
-rw-r–r--. 1 root root 580 Jul 15 19:39 id_rsa.pub(公钥)
[root@localhost ~]# scp /root/.ssh/id_rsa.pub 192.168.153.135:/root/.ssh/authorized_keys(将公钥发给B)
root@192.168.153.135’s password:
id_rsa.pub 100% 580 815.6KB/s 00:00
测试
[root@localhost ~]# ssh root@192.168.153.135
Activate the web console with: systemctl enable --now cockpit.socket

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register

Last login: Thu Jul 15 18:47:49 2021 from 192.168.153.1
[root@localhost ~]#

B(登录A,自动生成 /root/.ssh)
[root@localhost ~]# ssh root@192.168.153.132
The authenticity of host ‘192.168.153.132 (192.168.153.132)’ can’t be established.
ECDSA key fingerprint is SHA256:CRJbSWLLeiWfjON8N1Vk5Gscww3vxArqLM4dV2p/ZiY.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘192.168.153.132’ (ECDSA) to the list of known hosts.
root@192.168.153.132’s password:
Activate the web console with: systemctl enable --now cockpit.socket

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register

Last login: Thu Jul 15 18:47:29 2021 from 192.168.153.1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值