📜  如何在 termux 中使用 ssh - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:49.395000             🧑  作者: Mango

代码示例1
apt install openssh
sshd
touch ~/.ssh/authorized_keys
# Set Permissions to the file
chmod 600 ~/.ssh/authorized_keys
# Make sure the folder .ssh folder has the correct permissions
chmod 700 ~/.ssh
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# -i $PATH_TO_FILE/filename is only required if the id_rsa file is not ~/.ssh/id_rsa
ssh localhost -p 8022 -i %PATH_TO_KEY-FILE%/%NAME_OF_KEY%