[英]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.