Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu Can';t将SSH插入家庭计算机_Ubuntu_Ssh_Openssh_Sshd - Fatal编程技术网

Ubuntu Can';t将SSH插入家庭计算机

Ubuntu Can';t将SSH插入家庭计算机,ubuntu,ssh,openssh,sshd,Ubuntu,Ssh,Openssh,Sshd,我正试图用SSH从MacOSX计算机连接到Ubuntu计算机。我在Ubuntu上安装了openssh,并禁用了防火墙。我以前在这台Macbook上用ssh连接过其他服务器。我没有收到Ubuntu服务器的响应: $ ssh -v <domain_name> OpenSSH_7.8p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config lin

我正试图用SSH从MacOSX计算机连接到Ubuntu计算机。我在Ubuntu上安装了openssh,并禁用了防火墙。我以前在这台Macbook上用ssh连接过其他服务器。我没有收到Ubuntu服务器的响应:

$ ssh -v <domain_name>
OpenSSH_7.8p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to <domain_name> port 22.
ssh: connect to host <domain_name> port 22: Operation timed out
$ssh-v
OpenSSH_7.8p1,LibreSSL 2.7.3
debug1:读取配置数据/etc/ssh/ssh\u config
debug1:/etc/ssh/ssh_config第48行:应用*
debug1:连接到端口22。
ssh:连接到主机端口22:操作超时

我已经尝试过ping域名了,这很有效。我在Ubuntu计算机上运行了“ssh localhost”,效果很好。我还检查了端口22是否正在侦听,是否为ssh,是否为。我试着用sshusername@domain_name'. 同样的回答。有什么想法吗?

正如询问者的评论所指出的,目标计算机的IP是一个子网IP,这表明该目标位于某些设备后面,例如路由器或类似设备

然后,
ping
ing到域名,从路由器,将以该路由器为目标,但您可能不知道这一点


要解决此问题,只需在路由器上配置端口转发,“当从
接收数据时,将其转发到
”,然后ssh请求将被转发到预期目的地。

您的家庭计算机是在子网中的域名下还是直接在域名下?我不知道如何检查……这是一台具有用户帐户(用户名和密码)的常规ubuntu计算机。在您的ubuntu计算机上,
$ifconfig
并检查是否有显示为inet4/inet6地址的IP与域名的IP相同(无子网),或IP为192.168.*(有子网,需要端口转发)。首先,找出Ubuntu的IP地址。键入ifconfig并从终端获取IP,然后转到Mac并尝试ping Ubuntu的IP地址。@Hackerman在windows PSP和Mac上,nmap是检查您是否可以从计算机访问端口22的好选项。