Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac使用 #1

Open
xiaojidan opened this issue Jun 22, 2019 · 4 comments
Open

mac使用 #1

xiaojidan opened this issue Jun 22, 2019 · 4 comments

Comments

@xiaojidan
Copy link

你们是使用mac上写代码 然后ssh连接到Linux上跑程序么?可以任何网络远程么

@ypwhs
Copy link
Owner

ypwhs commented Jun 22, 2019

是的,我们都是在 Mac 上写代码,然后远程在服务器上跑代码的。
开发的时候,Mac 和显卡机都在内网下。部署的时候服务器会在机房里。

开发的时候,除了 ssh 连上去跑程序,还可以使用 Pycharm 远程调试。编辑过的代码会自动上传,下断点、Profile 也可以像在本地一样调试。参考链接:https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html

最好不要把机器暴露在公网上,容易被攻击。运维会配置跳板机或者 VPN 来访问远程机器。

@xiaojidan
Copy link
Author

@ypwhs 谢谢啦 我想问下内网是不是不可以联网呢?是不是局域网?公网是不是指我们平时上的网呢?

@ypwhs
Copy link
Owner

ypwhs commented Jun 23, 2019

@ypwhs 谢谢啦 我想问下内网是不是不可以联网呢?是不是局域网?公网是不是指我们平时上的网呢?

内网的意思就是在一个路由器下的子网,可以连接到互联网,也可以不连。如果路由器连接到了互联网,那么这个内网环境下的设备就都可以上网。家用环境下,连接到路由器的各个设备都是可以上网的。

公网和互联网也不是一个概念,能上互联网,不一定有公网 IP,这取决于运营商是否给你分配公网 IP。

在家用环境下,如果路由器有公网 IP,可以通过给路由器配置端口映射,把内网机器的端口映射到互联网中,这样即使你不在家,也可以通过路由器的公网 IP 以及你配置的端口连接到家里的机器。

为了避免路由器拨号导致公网 IP 发生变化,可以给路由器配置 DDNS,也就是给它配置一个域名,然后通过域名解析到对应的 IP 地址。

@xiaojidan
Copy link
Author

@ypwhs 好的 谢谢啦 了解了解了 感谢感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants