【ROC-RK3568-PC开发板试用体验】ssh登录root与第一个c程序

本帖最后由 Firefly搬运工 于 2022-9-15 15:43 编辑

SSH登录用户firefly

如果使用CRT建议使用8.3以上版本否则会报错

Key exchange failed.
No compatible key-exchange method. The server supports these methods: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256](mailto:curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256)

先登录ubuntu桌面,连接WIFI,终端中使用ifconfig查看 wlan0的ip,我这里是192.168.2.26

由于连接的wifi,重启后可能会动态变化。

使用crt创建ssh登录

提示如下错误

勾选如下配置

再回车重新连接

输入密码firefly

登录成功

SSH登录用户root

默认不支持ssh登录root

登录ubuntu桌面在终端中输入sed -i -e ‘s/#PermitRootLogin.*/PermitRootLogin yes/g’ /etc/ssh/sshd_config

使能ssh登录root

终端中输入

sudo su进入root用户

passwd回车

输入密码123

再次输入密码123

修改root用户的密码

再按照登录firefly一样登录

密码是刚才修改的123

第一个c程序

Ssh登陆root后,输入gcc -v查看gcc版本

如果没有安装gcc 则apt install gcc安装

vi hello.c 新建文件

按i按键进入编辑模式

输入如下代码


按esc按键

输入:

输入wq回车B保存

编译

gcc hello.c -o hello

运行输入./hello 回车

root@firefly:~# ./hello

Hello World!

总结

开发版运行的是完整的ubuntu20.04系统,可以在线安装开发环境,无需交叉开发十分方便,得益于板子的强劲性能。

注意ssh登录如果使用crt需要高版本支持相应的key-exchange method.

SSH登录root需要手动使能。