如何在 OS X 10.6.7 中打开端口 22
我正在尝试在 osx 上打开端口 22,以便可以使用 ssh 连接到本地主机。这是我目前的情况:
ssh localhost
ssh: connect to host localhost port 22: Connection refused
我已经生成了一个密钥并将其放入我的authorized_keys 文件中,如下所示:
sh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
“网络实用程序”端口扫描确认 22 个(令人惊讶的是 23 个)已关闭。
背景:我正在努力在本地设置 Hadoop。在我的配置中,我在 localhost:####s 上运行服务,并且需要通过 ssh 打开与它们的通信。
怎么才能打开22呢?或者我可能会遇到另一个问题(也许生成的密钥不正确?)
I am trying to open port 22 on osx so I can connect to localhost using ssh. This is my current situation:
ssh localhost
ssh: connect to host localhost port 22: Connection refused
I have generated a key and tossed it into my authorized_keys file like so:
sh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
A "Network Utility" port scan confirms that 22 (and surprisingly 23) are closed.
Context: I am working on getting Hadoop set up locally. In my configuration, I am running services on localhost:####s and need to open communications to them via ssh.
How can I open 22? or could I be up against another issue (improperly generated key perhaps?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我认为你的端口可能是开放的,但你没有任何东西可以监听它。
这些说明是从 在 Mac OS X 中启用 SSH 复制的,但我想要确保它们不会消失并提供快速访问。
I think your port is probably open, but you don't have anything that listens on it.
These instructions are copied from Enable SSH in Mac OS X, but I wanted to make sure they won't go away and to provide quick access.
我正在使用 OSX 10.11.6 和 这篇文章对我有用。
I'm using OSX 10.11.6 and this article works for me.
有 3 种解决方案可用于解决这些问题。
1)使用以下命令启用远程登录
- sudo systemsetup -setremotelogin on
2) 在 Mac 中,转到系统偏好设置 ->分享->启用远程登录
就是这样。 100% 有效的解决方案
3) 最终也是最重要的解决方案是 - 检查您的专用区域网络连接。有时局域网内不允许远程登录。
请尝试使用移动网络、热点等个人网络连接您的机器
There are 3 solutions available for these.
1) Enable remote login using below command
- sudo systemsetup -setremotelogin on
2) In Mac, go to System Preference -> Sharing -> enable Remote Login
that's it. 100% working solution
3) Final and most important solution is - Check your private area network connection . Sometime remote login isn't allow inside the local area network.
Kindly try to connect your machine using personal network like mobile network, Hotspot etc.
如果您尝试从终端窗口启用远程登录,您可能会遇到“完整磁盘权限问题”。或者,您可以从Apple Icon -> 启用它。系统偏好设置->共享
我正在使用 Mac-bigSur,这就是我在我的计算机上启用它的方法
您还可以允许特定用户访问。
If you try to enable remote login from a terminal window, you may get a "full disk permission issue". Alternatively, You can enable it from Apple Icon -> System Preferences -> Sharing
I am using Mac-bigSur and this is how I enable it on my machine
You can allow access to specific users also.
根据 macOS 10.14.5,详细信息如下:
转到
As per macOS 10.14.5, below are the details:
Go to
我无法解决问题;然后我执行了以下操作,问题得到解决:
请参阅此处:
I couldn't solve the problem; Then I did the following and the issue was resolved:
Refer here: