RHCE课程作业-01

  1. linux配置桥接
[root@zhujd ~]# nmcli connection add type bridge con-name br1 ifname br1 ipv4.addresses 192.168.5.200/24 ipv4.gateway 192.168.5.2 ipv4.method manual
[root@zhujd ~]# nmcli connection add type bridge-slave con-name br1-port1 ifname ens224 master br1
[root@zhujd ~]# nmcli connection up br1-port1 
[root@zhujd ~]# nmcli connection up br1
  1. ssh:拒绝用户远程登录
    在/etc/ssh/sshd_config文件中加入AllowUsers Username(不存在的用户名)
[root@zhujd ssh]# vim /etc/ssh/sshd_config 
# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
AllowUsers Username
  1. ssh免密登录
    先将主机生成的公钥写入authorized_keys,通过远程传输,将文件发到目标主机的~/.ssh/
[root@zhujd ~]# ssh-keygen -t rsa
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:ZKxggISCeeKAZ6dEwrsIHuhU7lgWiItbQ45pthhPt3c root@zhujd
The key's randomart image is:
+---[RSA 3072]----+
|O=+              |
|@+*+.  .         |
|*%+o+   +        |
|OB*=.. +         |
|X*Oo .. S        |
|+*... . E        |
|     . .         |
|                 |
|                 |
+----[SHA256]-----+
[root@zhujd .ssh]# cat id_rsa.pub  >> authorized_keys
[root@zhujd .ssh]# scp authorized_keys 192.168.5.134:~/.ssh/
root@192.168.5.134's password: 
authorized_keys                                                                           100%  564   393.9KB/s   00:00    
[root@zhujd .ssh]# 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值