1. how to install and enable openssh-server
2. how to auto-start sshd after reboot
3. how to be more secure for login
Instruction from:
http://www.drchaos.com/enable-ssh-on-kali-linux/
http://www.linuxproblem.org/art_9.html
Answer:
1. how to install and enable openssh-server
apt-get install openssh-server
2. how to auto-start sshd after reboot
update-rc.d -f ssh remove
update-rc.d -f ssh defaults
mkdir insecure_original_default_kali_keys
mv ssh_host_* insecure_original_default_kali_keys/
dpkg-reconfigure openssh-server
vi /etc/ssh/sshd_config
ssh-keygen -t rsa
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh
chmod 640 /root/.ssh/authorized_keys
service sshd start
# === manual steps on Windows ===
use winscp to copy /root/.ssh/id_rsa from kali VM, with username and password
use xshell to login kali VM by id_rsa file
use winscp to login kali VM by id_rsa.ppk file
use putty to login kali VM by id_rsa.ppk file
# === back to Kali shell ===
vi /etc/ssh/sshd.conf
service sshd restart
tail -f /var/log/auth.log
Conclusion
1. change password (CLI: passwd) first
2. setup ssh server
3. ssh login without password (and prohibit login with password)
沒有留言:
張貼留言