参考 https://www.lmgsecurity.com/enable-start-ssh-kali-linux/
install_ssh.sh
#! /bin/bash
sudo apt install openssh-server
mkdir /etc/ssh/default_keys # 备份老的ssh keys
mv /etc/ssh/ssh_host_* /etc/ssh/default_keys/
sudo dpkg-reconfigure openssh-server # 生成新的ssh keys
sudo nano /etc/ssh/sshd_config
# 设置 PubkeyAuthentication yes
sudo systemctl enable ssh #添加开机自启动
sudo systemctl status ssh # 查看状态
虚拟机无法远程,设置虚拟机的网络连接为bridge
image-20200922233436105ssh远程上传下载文件
参照scp用法
https://www.cyberpratibha.com/how-to-use-scp-command-in-linux/
网友评论