AWS Management Console -> EC2 -> Security Groups -> EC2's Security Group -> Add Custom TCP Rule, 27017, AnyWhere
외부 접속 허용
계정을 만들어야 함 (그렇지 않으면 외부에서 해당 포트/주소로 아무나 접속이 가능하기 때문)
mongo use admin db.createUser( { user: "davelee", pwd: "korea123", roles: [ "userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"] } )
- sudo vim /etc/mongod.conf
- Add the following configurations
security: authorization: enabled
- sudo service mongod restart