day 04 考不完的试

来源:互联网 发布:dnf制卡辅助与端口辅助 编辑:程序博客网 时间:2024/06/02 03:53

练习:

 已有desktop和server两台虚拟机,配置如下:

 1). 打包desktop主机上的/home目录,格式为YYYY_MM_DD_home.tar.gz并保存在/mnt目录;

tar zcf /mnt/`date +%F`.tar.gz /home

2). 无密码传输该打包文件到server主机的/home/student/目录下;

先在desktop主机操作:

ssh-keygen

ssh-copy-id -i /root/.ssh/id_rsa.pub root@172.25.254.140  

scp /mnt/2017-01-09.tar.gz root@172.25.254.140:/home/student/

3). desktop主机通过命令将server主机的压缩包解压到/home/student/Downloads目录下;

先连接到server主机上ssh root@172.25.254.140   

tar xf /home/student/2017-01-09.tar.gz -C /home/student/Downloads

4). 不允许以密码认证方式远程连接server主机;

在server上 vim /etc/ssh/sshd_config,在78行把PasswordAuthentication yes改为PasswordAuthentication no

然后写一行AllowUsers student


0 0
原创粉丝点击