Program Tip

RabbitMQ 3.3.1은 게스트 / 게스트로 로그인 할 수 없습니다.

programtip 2020. 11. 12. 20:08
반응형

RabbitMQ 3.3.1은 게스트 / 게스트로 로그인 할 수 없습니다.


VPS Debian Linux 상자에 최신 버전의 RabbitMQ를 설치했습니다. 게스트 / 게스트를 통해 로그인을 시도했지만 login failed 메시지와 함께 반환되었습니다 . 나는 약간의 조사를했고 보안상의 이유로 게스트 / 게스트를 통해 원격으로 로그인하는 것이 금지되어 있음을 발견했습니다.

또한 rabbitmq.config수동으로 파일 을 생성하고 (설치시 파일 이 생성 되지 않았기 때문에) 다음 항목 만 배치 하여이 버전에서 게스트 사용을 활성화하여 원격으로 로그인하도록 시도했습니다.

[{rabbit, [{loopback_users, []}]}].

다음 명령으로 rabbitmq를 다시 시작한 후.

invoke-rc.d rabbitmq-server stop -- to stop
invoke-rc.d rabbitmq-server start -- to start

여전히 게스트 / 게스트로 로그인되지 않았습니다. 또한 Windows VPS에 RabbitMQ를 설치하려고 시도하고 localhost를 통해 게스트 / 게스트를 통해 로그인을 시도했지만 다시 동일한 메시지 로그인 실패가 발생 합니다.

또한 게스트 / 게스트를 통해 원격으로 로깅을 지원하는 RabbitMQ의 이전 버전을 설치할 수있는 소스를 제공하십시오.


똑같은 문제가 ..

RabbitMQ와 Enabled Web Interface도 설치했지만 새로 생성 한 사용자로 로그인 할 수 없었습니다. 이는 관리자 권한이 있어야 액세스 할 수 있기 때문입니다.

구성 파일을 생성하지 말고 엉망으로 만드십시오 ..

이것이 내가 한 일입니다.

  1. 새로운 / 새 사용자를 추가하고 사용자 test와 비밀번호를 말합니다 test.

    rabbitmqctl add_user test test
    
  2. 새 사용자에게 관리 액세스 권한을 부여하십시오.

    rabbitmqctl set_user_tags test administrator
    
  3. 새로 생성 된 사용자에게 권한 설정 :

    rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
    

그게 다야, 즐기세요 :)


다음 단계에 따라 Debian에서 동일한 구성을 시도했습니다.

  1. RabbitMQ를 설치했습니다.
  2. 웹 관리 플러그인을 활성화했습니다 (필요하지 않음).

로그인을 시도 할 때 동일한 오류가 발생했습니다.

여기에 이미지 설명 입력

그래서 다음 내용 (마지막 점에 주목)으로 디렉토리 안에 rabbitmq.config파일 ( 클래식 구성 파일 )을 생성했습니다 /etc/rabbitmq.

[{토끼, [{loopback_users, []}]}].

또는 다음 내용으로 동일한 디렉토리 내에 rabbitmq.conf파일 ( 새 구성 파일 )을 대신 생성 할 수 있습니다 .

loopback_users = 없음

그런 다음 invoke-rc.d rabbitmq-server start명령을 실행하고 콘솔과 Java 클라이언트 모두 게스트 / 게스트 자격 증명을 사용하여 연결할 수있었습니다.

여기에 이미지 설명 입력

따라서이 절차가 작동하지 않으면 다른 문제가 있다고 생각합니다. 예를 들어 어떤 이유로 RABBITMQ_CONFIG_FILE환경 변수를 변경 한 경우 RabbitMQ가 구성 파일을 읽지 못할 수 있습니다 .


이것은 버전 3.3.0 이후의 새로운 기능입니다. localhost에서 guest / guest를 사용해서 만 로그인 할 수 있습니다. 다른 컴퓨터 또는 IP에서 로깅하려면 사용자를 만들고 권한을 할당해야합니다. 다음과 같이 수행 할 수 있습니다.

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

주의 : 포트가 15672인지 확인하십시오! (버전> 3.3) 5672가 작동하지 않는 경우

먼저 "위에서 선택한 답변"을 확인하십시오.

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

그래도 연결이되지 않으면 포트가 올바른지 확인하세요!

나를 위해이 명령은 작동합니다.

$ rabbitmqadmin -H 10.140.0.2 -P 15672 -u test -p test list vhosts
+------+----------+
| name | messages |
+------+----------+
| /    |          |
+------+----------+

완료된 포트에 대해 다음을 확인하십시오. RabbitMQ는 어떤 포트를 사용합니까?

to verify your rabbit mq server, check this: Verify version of rabbitmq

p.s.

For me, after I created the "test" user and run set_user_tags, set_permissions , I can't connect to rabbitmq via port 5672. but I can connect via 15672.

However, port 15672 always gives me a "blank response". and my code stop working.

so about 5 minutes later, I switched to 5672, everything worked!

Very wired problem. I have no time to dig deeper. so I wrote it down here for someone meeting the same problems.


for other guys which use Ansible for RabbitMQ provisioning, what I missed for rabbitmq_user module was tags: administrator

here is my working Ansible configuration to recreate "guest" user (for development environment purpose, don't do that in production environment):

- name: Create RabbitMQ user "guest" become: yes rabbitmq_user: user: guest password: guest vhost: / configure_priv: .* read_priv: .* write_priv: .* tags: administrator force: yes # recreate existing user state: present

and I also had to setup a file /etc/rabbitmq/rabbitmq.config containing the following:

[{rabbit, [{loopback_users, []}]}].

in order to be able to log using "guest"/"guest" from outside of localhost


I had the same problem. I tried what was suggested by Gas and ran "invoke-rc.d rabbitmq-server start" it didn't start. I tried to reboot the server and the webui worked with the guest user. Maybe after adding the rabbitmq.config file, something else also needed to started.

I used rabbitmq version 3.5.3.

One more thing to note: if you're using AWS instance then you need to open inbound port 15672. (The port for RabbitMQ versions prior to 3.0 is 55672.).


Students and I stared at this problem for an hour. Be sure you've named your files correctly. In the /etc/rabbitmq directory, there are two distinct files. There is an /etc/rabbitmq/rabbitmq.config file which you should edit to get the loopback users as described, but there is another file called rabbitmq-env.conf file. Many folks were using tab completion and just adding "ig", which isn't the right file. Double check!


sometimes you don't need the comma , which is there in the configuration file by default , if nothing else is configured below rabbit tag , while starting broker we will get a crash

like {loopback_users, []} , I spend many times hours forgetting this and later removing the comma , it is applicable for all other configurations including SSL


Try restart your rabbitmq and login again, for me work.


약간 다른 사용을 위해,하지만 목적을 모니터링하기위한 API에 액세스 다루는 사람에게 유용 할 수 있습니다 : 나는 Oliboy50 잘 작동 @에 의해 주어진 답을 확인할 수 있습니다 그러나 당신이 당신이 사용자가 할 수 있도록하려면 각 가상 호스트에 대한 활성화하기 다음과 같은 모니터 :

      permissions:
    - vhost: "{{item.name}}"
      configure_priv: .*
      write_priv: .*
      read_priv: .*
  state: present
  tags: management
with_items: "{{user_system_users}}"

이 루프를 통해 모든 가상 호스트에 API를 사용할 때 "401 Unauthorized"오류를 통과 할 수있었습니다.


정보 보고서 아래의 로그 파일을 확인하면 이것을 얻을 수 있습니다.

`config file(s) : /etc/rabbitmq/rabbitmq.config (not found)`. 

아래 명령을 사용하여 구성 파일 권한을 변경 한 다음 게스트를 사용하여 로그인하면 작동합니다.

sudo chmod 777 /etc/rabbitmq/rabbitmq.config

참고 URL : https://stackoverflow.com/questions/23669780/rabbitmq-3-3-1-can-not-login-with-guest-guest

반응형