[英]Linux, MongoDB: Open failed: administratively prohibited, but only for port 27017
我收到错误“ Open failed: administratively prohibited
尝试通过ssh连接到mongodb
数据库的Open failed: administratively prohibited
。
从其他SO帖子看来,这可能是由于/etc/sshd/sshd_config
的变量AllowTcpConnections yes
引起的。
因此,我确保在服务器上正确设置了变量-我也尝试了其他端口(例如jupyter笔记本电脑的8888或其他端口,它们确实起作用了!)
关于此事,mongodb /或该端口有什么特定的吗?
根据这篇文章:
https://ianlondon.github.io/blog/mongodb-auth/
您需要做三件事:
1)编辑MongoDB配置文件:
sudo vim /etc/mongod.conf
2)注释掉bindIp
行:
# bindIp: 127.0.0.1 <- comment out this line
3)取消security
线注释:
security:
authorization: 'enabled'
最后,您应该具有一些允许远程连接的授权凭据(用户名/密码或ssh密钥等)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.