ssh
报错
小米路由器解锁了ssh之后,如果直接ssh路由器,会报错
Unable to negotiate with 192.168.31.1 port 22: no matching host key type found. Their offer: ssh-rsa这是由于小米内置的ssh服务版本较低,不支持服务器提供的主机密钥类型
解决方案
在ssh命令中指定ssh-rsa算法
ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa root@192.168.31.1在ssh的config文件中配置
Host mi HostName 192.168.31.1 User root HostKeyAlgorithms +ssh-rsa PubkeyAcceptedAlgorithms +ssh-rsa然后可以直接使用下面的命令连接路由器
ssh miscp
前提
如果要使用scp上传文件,首先需要解决ssh的报错
报错
如果直接使用scp往小米路由器内上传文件,会报错
ash: /usr/libexec/sftp-server: not foundscp: Connection closed解决方案
scp -O test.txt mi:/data/