实验2

如何设置Ubuntu的远程连接root

1.切换成root
sudo -i 


1.5 设置个root密码
passwd

image-20240223152728774

2.进入nano /etc/ssh/sshd_config
nano /etc/ssh/sshd_config

image-20240223151707672

3.修改这个位置
PermitRootlogin yes

image-20240223152036422

4.保存
ctrl+x
5.确定
y
6.回车
enter
7.效果

image-20240223152848352

image-20240223153126676

结果:

Ubuntu2004和Ubuntu2204都成功了

实验--练习

练习:

1、显示当前时间,格式:2016-06-18 10:20:30

[11:40:00 root@localhost ~][#date +'%F %T'
2024-02-23 11:40:26

2、显示前天是星期几

[11:43:16 root@localhost ~][#date -d '-2 day' +'%F %T'
2024-02-21 11:43:47
#其中-2就是昨天  所以它显示的是昨天 

3、设置当前日期为2019-08-07 06:05:10

 date -s "20190807 06:05:10"
posted @ 2024-02-23 21:23  三思博客  阅读(7)  评论(0编辑  收藏  举报