简体   繁体   中英

How to ssh raspberry pi outside the local network

I have a little problem with my ssh, I'm trying to ssh my raspberry pi from the outside of the network with the public Ip.

Things I done: - Forward the port 22(TCP) on the router - Change some parameter to the ssh_config and sshd_config

When I try to connect with the public Ip, Putty give me this error(ssh connection refused) I now my password and username are right because when I use ssh but with local up it works.

I thinks I have to change a parameter in the ssh_config to allow connections from the outside of the network.

If you have an idea please let me know Thanks

Moreover, make sure you set a static IP address for the Raspi in router, because, if you don't do so, your port forwarding can become outdated.

Same happens with your public IP. From time to time it can be changed by your ISP. You should use a service for DDNS and connect through a domain to your router/raspi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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