Jetson Orin(Ubuntu20.04)反馈SSH远程别的设备可以成功,别的设备无法登录本机设备

本文主要是介绍Jetson Orin(Ubuntu20.04)反馈SSH远程别的设备可以成功,别的设备无法登录本机设备,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

硬件设备,Jetson Orin设备

Jetpack 版本5.0.2

这样的问题一般都是本机的权限问题,看下你本机的配置

测一下登录本机ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused目前是禁止连接的。

正常是可以登录的。如下图:

 

 接下来的操作都是在修复jetson无法ssh登录的问题。

 sudo apt-get install openssh-server openssh-client

sudo apt-get install ufw

sudo ufw enable 

 这个时候还没想到直接下载iptables

 

如上图是在摸索,下面是正确的下载方式。

 

 继续查看22号端口的状态

sudo ufw allow 22  

lsof -i:22

sudo netstat -nltp | grep 22

到此只是解决了防火墙的使用问题。继续测试能否登录。如下,发现了红色报错部分。

下面是正确22号端口的状态

sshd -T

提示sshd: no hostkeys available – exiting.

 又做了如下操作。

 ubuntu下sshd: no hostkeys available -- exiting.

今天使用

/usr/sbin/sshd

代码想启动ssh,结果一直报错,一直报错,找寻各种方法无果。后来找安装教程,发现人用的是

ssh-keygen -t rsa

试了下,直接启动。如果你搜到这个问题,看看是不是也是这个情况。

systemctl stop ssh.service    //关闭由systemctl控制的ssh启动rm /lib/systemd/system/ssh.service      //删除ssh的服务配置文件systemctl daemon-reload         //重载systemctl服务systemctl start ssh.service //重启服务

 到此还是无法正常使用,接着试吧。

 如下这个操作其实和我的错误没有关系,记录一下。

 按照朋友的方法最后忘了在哪看的,输入sudo dpkg-reconfigure openssh-server就可以了,然而对我的错误还是没有解决,不过还是要记录一下,看到这你别骂我,多记录总归是个回忆。

脑回路一转又撞到了防护墙,真实要撞南墙的节奏。

 发现开着也接受22号,不行就关了防护墙接受把,接着试试。

 

 我最后打开了22号端口,添加ubuntu22.04解决ssh登录,找不到匹配的host key算法,添加如下两行内容

HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

sudo vim /etc/ssh/sshd_config 这是别人打开的配置文件,

我少打了一个字母添加到了sudo vi /etc/ssh/ssh_config,打开了22号注释,不过也能用了哈哈

 sudo systemctl restart sshd 

到此,可以登录了,果然无证驾驶又出了绕了弯路,欢迎大佬指点!

如下是系统问题无法SSH登录全过程终端操作命令历史记录,一般按照上面的过程安装一遍即可。

nvidia@tegra-ubuntu:~/Desktop$ sudo apt-get install ip6tables-persistent
[sudo] password for nvidia: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ip6tables-persistent
nvidia@tegra-ubuntu:~/Desktop$ sudo apt-get install iptables-persistent
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:netfilter-persistent
The following NEW packages will be installed:iptables-persistent netfilter-persistent
0 upgraded, 2 newly installed, 0 to remove and 324 not upgraded.
Need to get 13.8 kB of archives.
After this operation, 89.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 netfilter-persistent all 1.0.14ubuntu1 [7,268 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 iptables-persistent all 1.0.14ubuntu1 [6,552 B]
Fetched 13.8 kB in 1s (16.6 kB/s)              
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package netfilter-persistent.
dpkg: warning: files list file for package 'openssh-server' missing; assuming package has no files currently installed
(Reading database ... 147380 files and directories currently installed.)
Preparing to unpack .../netfilter-persistent_1.0.14ubuntu1_all.deb ...
Unpacking netfilter-persistent (1.0.14ubuntu1) ...
Selecting previously unselected package iptables-persistent.
Preparing to unpack .../iptables-persistent_1.0.14ubuntu1_all.deb ...
Unpacking iptables-persistent (1.0.14ubuntu1) ...
Setting up netfilter-persistent (1.0.14ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/netfilter-persistent.service → /lib/systemd/system/netfilter-persistent.service.
Setting up iptables-persistent (1.0.14ubuntu1) ...
update-alternatives: using /lib/systemd/system/netfilter-persistent.service to provide /lib/systemd/system/iptables.service (iptables.service) in auto mode
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
nvidia@tegra-ubuntu:~/Desktop$ sudo netstat -nltp | grep 22
nvidia@tegra-ubuntu:~/Desktop$ sudo apt-get install ufw
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ufw is already the newest version (0.36-6ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 324 not upgraded.
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw enable
Firewall is active and enabled on system startup
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw allow 22
Skipping adding existing rule
Skipping adding existing rule (v6)
nvidia@tegra-ubuntu:~/Desktop$ 

sudo apt-get install iptables-persistent
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:netfilter-persistent
The following NEW packages will be installed:iptables-persistent netfilter-persistent
0 upgraded, 2 newly installed, 0 to remove and 324 not upgraded.
Need to get 13.8 kB of archives.
After this operation, 89.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 netfilter-persistent all 1.0.14ubuntu1 [7,268 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 iptables-persistent all 1.0.14ubuntu1 [6,552 B]
Fetched 13.8 kB in 1s (16.6 kB/s)              
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package netfilter-persistent.
dpkg: warning: files list file for package 'openssh-server' missing; assuming package has no files currently installed
(Reading database ... 147380 files and directories currently installed.)
Preparing to unpack .../netfilter-persistent_1.0.14ubuntu1_all.deb ...
Unpacking netfilter-persistent (1.0.14ubuntu1) ...
Selecting previously unselected package iptables-persistent.
Preparing to unpack .../iptables-persistent_1.0.14ubuntu1_all.deb ...
Unpacking iptables-persistent (1.0.14ubuntu1) ...
Setting up netfilter-persistent (1.0.14ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/netfilter-persistent.service → /lib/systemd/system/netfilter-persistent.service.
Setting up iptables-persistent (1.0.14ubuntu1) ...
update-alternatives: using /lib/systemd/system/netfilter-persistent.service to provide /lib/systemd/system/iptables.service (iptables.service) in auto mode
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
nvidia@tegra-ubuntu:~/Desktop$ sudo netstat -nltp | grep 22
nvidia@tegra-ubuntu:~/Desktop$ sudo apt-get install ufw
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ufw is already the newest version (0.36-6ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 324 not upgraded.
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw enable
Firewall is active and enabled on system startup
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw allow 22
Skipping adding existing rule
Skipping adding existing rule (v6)
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ service sshd restart
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
nvidia@tegra-ubuntu:~/Desktop$ sudo service sshd restart
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service 
● ssh.service - OpenBSD Secure Shell serverLoaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Tue 2023-04-04 09:30:00 UTC; 19s agoDocs: man:sshd(8)man:sshd_config(5)Process: 4358 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)Apr 04 09:30:00 tegra-ubuntu systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
Apr 04 09:30:00 tegra-ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Apr 04 09:30:00 tegra-ubuntu systemd[1]: ssh.service: Start request repeated too quickly.
Apr 04 09:30:00 tegra-ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Apr 04 09:30:00 tegra-ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Apr 04 09:30:07 tegra-ubuntu systemd[1]: ssh.service: Start request repeated too quickly.
Apr 04 09:30:07 tegra-ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Apr 04 09:30:07 tegra-ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo vi /etc/ssh/ssh_config
nvidia@tegra-ubuntu:~/Desktop$ sshd -T
sshd: no hostkeys available -- exiting.
nvidia@tegra-ubuntu:~/Desktop$ systemctl stop ssh.service
nvidia@tegra-ubuntu:~/Desktop$ sudo rm /lib/systemd/system/ssh.service 
nvidia@tegra-ubuntu:~/Desktop$ systemctl daemon-reload 
nvidia@tegra-ubuntu:~/Desktop$ systemctl start ssh.socket 
nvidia@tegra-ubuntu:~/Desktop$ systemctl start ssh.service
nvidia@tegra-ubuntu:~/Desktop$ ls
gnome-terminal.desktop  nv_forums.desktop           nv_jetson_zoo.desktop
nv_devzone.desktop      nv_jetson_projects.desktop  nv_l4t_readme.desktop
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.serviceFailed to start ssh.service: Connection timed out
See system logs and 'systemctl status ssh.service' for details.failed!
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 2h 58min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ ssh-keygen -A
ssh-keygen: generating new host keys: RSA Could not save your public key in /etc/ssh/ssh_host_rsa_key.K1nvHGTwzM: Permission denied
ssh-keygen: generating new host keys: DSA Could not save your public key in /etc/ssh/ssh_host_dsa_key.ozu0XOi5Bt: Permission denied
ssh-keygen: generating new host keys: ECDSA Could not save your public key in /etc/ssh/ssh_host_ecdsa_key.gTMnQdFSb8: Permission denied
ssh-keygen: generating new host keys: ED25519 Could not save your public key in /etc/ssh/ssh_host_ed25519_key.33AuhJCeht: Permission denied
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh-keygen -A
[sudo] password for nvidia: 
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 2h 59min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ service ssh status
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 2min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh-keygen -A
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ service ssh status
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 3min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:DaBMEybUCJchmu7cAK8xXOyKJNBN/mBTthQzzMmTjy4 root@tegra-ubuntu
The key's randomart image is:
+---[RSA 3072]----+
|oo==*=O+         |
|.=+O.*B=         |
|= .oO .+.        |
|=.o. +. .o       |
|+=.. .. S .      |
|*++ E .          |
|o+ . .           |
|                 |
|                 |
+----[SHA256]-----+
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ service ssh status
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 4min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 5min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh-keygen -A
nvidia@tegra-ubuntu:~/Desktop$ sudo systemctl start sshd
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 7min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo dpkg-reconfigure openssh-server
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 15min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 15min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh nvidia@127.0.0.1
[sudo] password for nvidia: 
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ sudo netstat -nltp | grep 22
nvidia@tegra-ubuntu:~/Desktop$ service ssh status
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 32min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw status 
Status: activeTo                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
22 (v6)                    ALLOW       Anywhere (v6)             nvidia@tegra-ubuntu:~/Desktop$ sudo ufw disable
Firewall stopped and disabled on system startup
nvidia@tegra-ubuntu:~/Desktop$ service ssh status
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (exited) since Tue 2023-04-04 09:35:36 UTC; 3h 34min agoDocs: man:systemd-sysv-generator(8)Process: 4562 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Apr 04 09:35:36 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 09:35:36 tegra-ubuntu ssh[4571]: sshd: no hostkeys available -- exiting.
Apr 04 09:35:36 tegra-ubuntu ssh[4562]:    ...fail!
Apr 04 09:35:36 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
nvidia@tegra-ubuntu:~/Desktop$ sudo netstat -nltp | grep 22
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw status 
Status: inactive
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ ufw allow 22
ERROR: You need to be root to run this script
nvidia@tegra-ubuntu:~/Desktop$ sudo ufw allow 22
Skipping adding existing rule
Skipping adding existing rule (v6)
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh nvidia@127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ sudo apt-get install openbsd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package openbsd
nvidia@tegra-ubuntu:~/Desktop$ sudo vi /etc/ssh/ssh_config
nvidia@tegra-ubuntu:~/Desktop$ sudo systemctl restart sshd
nvidia@tegra-ubuntu:~/Desktop$ /etc/init.d/ssh start
Starting ssh (via systemctl): ssh.service.
nvidia@tegra-ubuntu:~/Desktop$ sudo ssh nvidia@127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:CCkCNwrmM/0rdsB6SeMRAX+5VjJNN0KmWTwkr2DzbuI.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
nvidia@127.0.0.1's password: 
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.10.104-tegra aarch64)* Documentation:  https://help.ubuntu.com* Management:     https://landscape.canonical.com* Support:        https://ubuntu.com/advantageThis system has been minimized by removing packages and content that are
not required on a system that users do not log into.To restore this content, you can run the 'unminimize' command.311 updates can be applied immediately.
229 of these updates are standard security updates.
To see these additional updates run: apt list --upgradableLast login: Tue Apr  4 07:35:48 2023
nvidia@tegra-ubuntu:~$ exit
logout
Connection to 127.0.0.1 closed.
nvidia@tegra-ubuntu:~/Desktop$ systemctl status ssh.service
● ssh.service - LSB: OpenBSD Secure Shell serverLoaded: loaded (/etc/init.d/ssh; generated)Active: active (running) since Tue 2023-04-04 13:19:58 UTC; 2min 23s agoDocs: man:systemd-sysv-generator(8)Process: 5284 ExecStart=/etc/init.d/ssh start (code=exited, status=0/SUCCESS)Tasks: 1 (limit: 36322)Memory: 1.0MCGroup: /system.slice/ssh.service└─5292 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startupsApr 04 13:19:58 tegra-ubuntu systemd[1]: Starting LSB: OpenBSD Secure Shell server...
Apr 04 13:19:58 tegra-ubuntu ssh[5284]:  * Starting OpenBSD Secure Shell server sshd
Apr 04 13:19:58 tegra-ubuntu ssh[5284]:    ...done.
Apr 04 13:19:58 tegra-ubuntu sshd[5292]: Server listening on 0.0.0.0 port 22.
Apr 04 13:19:58 tegra-ubuntu sshd[5292]: Server listening on :: port 22.
Apr 04 13:19:58 tegra-ubuntu systemd[1]: Started LSB: OpenBSD Secure Shell server.
Apr 04 13:20:19 tegra-ubuntu sshd[5318]: Accepted password for nvidia from 127.0.0.1 port 50654 ssh2
Apr 04 13:20:19 tegra-ubuntu sshd[5318]: pam_unix(sshd:session):

这篇关于Jetson Orin(Ubuntu20.04)反馈SSH远程别的设备可以成功,别的设备无法登录本机设备的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/324064

相关文章

VScode连接远程Linux服务器环境配置图文教程

《VScode连接远程Linux服务器环境配置图文教程》:本文主要介绍如何安装和配置VSCode,包括安装步骤、环境配置(如汉化包、远程SSH连接)、语言包安装(如C/C++插件)等,文中给出了详... 目录一、安装vscode二、环境配置1.中文汉化包2.安装remote-ssh,用于远程连接2.1安装2

golang1.23版本之前 Timer Reset方法无法正确使用

《golang1.23版本之前TimerReset方法无法正确使用》在Go1.23之前,使用`time.Reset`函数时需要先调用`Stop`并明确从timer的channel中抽取出东西,以避... 目录golang1.23 之前 Reset ​到底有什么问题golang1.23 之前到底应该如何正确的

mysql外键创建不成功/失效如何处理

《mysql外键创建不成功/失效如何处理》文章介绍了在MySQL5.5.40版本中,创建带有外键约束的`stu`和`grade`表时遇到的问题,发现`grade`表的`id`字段没有随着`studen... 当前mysql版本:SELECT VERSION();结果为:5.5.40。在复习mysql外键约

解决Cron定时任务中Pytest脚本无法发送邮件的问题

《解决Cron定时任务中Pytest脚本无法发送邮件的问题》文章探讨解决在Cron定时任务中运行Pytest脚本时邮件发送失败的问题,先优化环境变量,再检查Pytest邮件配置,接着配置文件确保SMT... 目录引言1. 环境变量优化:确保Cron任务可以正确执行解决方案:1.1. 创建一个脚本1.2. 修

Xshell远程连接失败以及解决方案

《Xshell远程连接失败以及解决方案》本文介绍了在Windows11家庭版和CentOS系统中解决Xshell无法连接远程服务器问题的步骤,在Windows11家庭版中,需要通过设置添加SSH功能并... 目录一.问题描述二.原因分析及解决办法2.1添加ssh功能2.2 在Windows中开启ssh服务2

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

python实现自动登录12306自动抢票功能

《python实现自动登录12306自动抢票功能》随着互联网技术的发展,越来越多的人选择通过网络平台购票,特别是在中国,12306作为官方火车票预订平台,承担了巨大的访问量,对于热门线路或者节假日出行... 目录一、遇到的问题?二、改进三、进阶–展望总结一、遇到的问题?1.url-正确的表头:就是首先ur

Java子线程无法获取Attributes的解决方法(最新推荐)

《Java子线程无法获取Attributes的解决方法(最新推荐)》在Java多线程编程中,子线程无法直接获取主线程设置的Attributes是一个常见问题,本文探讨了这一问题的原因,并提供了两种解决... 目录一、问题原因二、解决方案1. 直接传递数据2. 使用ThreadLocal(适用于线程独立数据)

Python实现局域网远程控制电脑

《Python实现局域网远程控制电脑》这篇文章主要为大家详细介绍了如何利用Python编写一个工具,可以实现远程控制局域网电脑关机,重启,注销等功能,感兴趣的小伙伴可以参考一下... 目录1.简介2. 运行效果3. 1.0版本相关源码服务端server.py客户端client.py4. 2.0版本相关源码1

使用@Slf4j注解,log.info()无法使用问题

《使用@Slf4j注解,log.info()无法使用问题》在使用Lombok的@Slf4j注解打印日志时遇到问题,通过降低Lombok版本(从1.18.x降至1.16.10)解决了问题... 目录@Slf4androidj注解,log.info()无法使用问题最后解决总结@Slf4j注解,log.info(