树莓派3B连接到wifi和ssh远程登录

xiaoxiao2021-03-01  14

一、树莓派3B连接到wifi

在安装了ubuntu系统时,会提示设置要连接的wifi,这时可以选择wifi,输入passwd,在/etc/NetworkManager/system-connections目录下保存有 以所连接的wifi的名称的文件名,用root用户修改该文件的权限为777,即可在文件中修改 ssid= 和 psk= ,就可连接到新的wifi下。

重启生效!!!

二、ssh远程登录

1、假设要连接的账户为 :shu ,ip=192.168.1.186,root账户密码为:123456!,

           本机的账户为 :kinetic,ip=192.168.1.160

那么,

在用户shu 即server 端执行:

For start the service

service sshd restart

If you are using Debian based OS then just follow these steps : for installation

sudo apt-get install openssh-server openssh-client

To restart ssh server, enter:

sudo /etc/init.d/ssh restart

2、Ubuntu开机之后会执行/etc/rc.local文件中的脚本,所以可以直接在 sever 端的 /etc/rc.local中添加启动脚本。

     sudo vi /etc/rc.local  ,在exit 0之前 添加:    /etc/init.d/ssh start

ssh连接远程主机时,出现 sign_and_send_pubkey: signing failed: agent refused operation 错误,并且还是需要输入密码,则执行:

     ssh-add 

参考文献:

(1)、https://blog.csdn.net/jayxujia123/article/details/34125791

(2)、https://blog.csdn.net/zengqiang1/article/details/52997885

在kinetic终端执行:

$ ssh-keygen -t rsa

一路回车即可。

然后在将生成的公钥复制到 shu 上的~/.ssh/authorized_keys中,使用如下命令:

$ ssh-copy-id -i ~/.ssh/id_rsa.pub shu@192.168.1.186

最后,测试免密码登录,在kinetic终端执行:

$ ssh shu@192.168.1.186

参考文献:

1、https://blog.csdn.net/furzoom/article/details/79139570

2、【ok】https://blog.csdn.net/jayxujia123/article/details/34125791 

转载请注明原文地址: https://www.6miu.com/read-3850083.html

最新回复(0)