kali安装开启ssh & 安装docker

ssh相关
一、配置SSH参数

1.  
修改sshd_config文件,命令为:
vi /etc/ssh/sshd_config
将#PasswordAuthentication no的注释去掉,并且将NO修改为YES //kali中默认是yes
  
2. 
将PermitRootLogin without-password修改为
PermitRootLogin yes
 
3. 
然后,保存,退出vim。
 
二、启动SSH服务
命令为:
/etc/init.d/ssh start
或者
service ssh start
三、查看SSH服务状态是否正常运行

命令为:
/etc/init.d/ssh status
或者
service ssh status
 
四、使用SSH登录工具(Putty\SecureCRT\XShell)登录kali
 
1.
输入用户名、密码后,如果使用SSH连接工具还是连不上kali 
 
2.
那么要先生成两个密钥:
#ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
#ssh-keygen -t dsa -f /etc/ssh/ssh_host_rsa_key
执行命令后都会让输入密码,直接敲回车设置为空即可
 
3.   
再使用SSH连接工具重新连接kali,成功搞定!
 
五、设置系统自动启动SSH服务
方法一:
sysv-rc-conf
sysv-rc-conf --list | grep ssh
sysv-rc-conf ssh on  //系统自动启动SSH服务
sysv-rc-conf ssh off  // 关闭系统自动启动SSH服务
方法二:
update-rc.d ssh enable  //系统自动启动SSH服务
update-rc.d ssh disabled // 关闭系统自动启动SSH服务
END




docker相关
1.设置仓库



安装 apt 依赖包,用于通过 HTTPS 来获取仓库。
sudo apt install    apt-transport-https    ca-certificates  curl    gnupg-agent    software-properties-common

添加 Docker 的官方 GPG 密钥:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

###阿里云
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | sudo apt-key add 

设置仓库
sudo echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" | sudo tee -a /etc/apt/sources.list
##阿里云的docker仓库
sudo echo "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/debian stretch stable" | sudo tee -a /etc/apt/sources.list
2.安装 Docker Engine-Community 更新 apt 包索引 sudo apt update 安装 Docke sudo apt install docker-ce docker-ce-cli containerd.io 参考菜鸟教程https://www.runoob.com/docker/debian-docker-install.html






安装docker源

mkdir -p /etc/docker && \
cat > /etc/docker/daemon.json <<EOF
{
   "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}
EOF

 

posted @ 2019-12-16 21:28  cui0x01  阅读(518)  评论(0编辑  收藏  举报