在Openwrt上使用SSH免密登录linux
由于OpenWRT上的ssh可执行文件与普通计算机上的SSH不同,我们需要在OpenWRT上安装完整版的OpenSSH。
1、在OpenWRT上打开终端,输入以下命令:
opkg update
opkg install openssh-client openssh-server
2、然后将OpenSSH添加到PATH环境变量中。在OpenWRT上打开终端,输入以下命令:
echo 'export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin"' >> /etc/profile
source /etc/profile
3、重新启动终端并测试SSH连接。在OpenWRT上打开终端,输入以下命令:
ssh -i /path/private_key user@ubuntu_ip_address