简体   繁体   English

树莓派:ssh 连接被拒绝

[英]Raspberry Pi: ssh connection refused

I have a problem with a raspberry pi.我的树莓派有问题。 This morning I switched on the raspi and the ssh does not work.今天早上我打开了 raspi 并且 ssh 不起作用。 If I try to connect typing如果我尝试连接打字

ssh -vvv pi@192.168.1.33

the output is this:输出是这样的:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.33 [192.168.1.33] port 22.
debug1: connect to address 192.168.1.33 port 22: Connection refused
ssh: connect to host 192.168.1.33 port 22: Connection refused

I want to underline that I have not edited any config file or similar from yesterday, when everything worked well.我想强调的是,我没有编辑任何配置文件或昨天的类似文件,当时一切都运行良好。

I don't know if this can be useful but I opened the file var/log/auth.log on the raspi but there is no line about today.我不知道这是否有用,但我在 raspi 上打开了文件 var/log/auth.log,但没有关于今天的行。 Just lines about yesterday.只是关于昨天的台词。 Probably ssh process does not start?可能是 ssh 进程没有启动?

I would advise double-checking your IP address, thus on your pi run the following command: 我建议您仔细检查您的IP地址,因此在pi上运行以下命令:

sudo ifconfig

I had a similar issue and it was from not realising that my Pi did not have the same IP address as the day before. 我遇到了类似的问题,这是因为我没有意识到我的Pi与前一天没有相同的IP地址。

In my case, I just forgot to connect my Pi and my laptop to the same router.就我而言,我只是忘记将我的 Pi 和我的笔记本电脑连接到同一个路由器。 My laptop was connected to my domestic wifi and my raspberry to another wifi source.我的笔记本电脑连接到我的家用 wifi,我的树莓派连接到另一个 wifi 源。 So my answer is, try to connect both through the same local network and retry the ssh process.所以我的答案是,尝试通过同一个本地网络连接两者并重试 ssh 过程。

If you want to connect through the world wide web, buy a domain.如果您想通过万维网进行连接,请购买域名。 It gives an address to your Pi.它为您的 Pi 提供了一个地址。

Else, there are several other answers on Stackoverflow.否则,Stackoverflow 上还有其他几个答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM