Update WireGaurd Package to 14 and set hashed password
Update WireGaurd Package to 14 and Set Hashed password
VPN 서버로 wireGaurd를 세팅하였고, 해당 패키지가 오래 되어서 업그레이드를 하게 되었습니다.
i used wireGaurd as my VPN server, and the server is not updated long time so i try to update the package.
기존에는 password를 plain 방식으로 제공해서 추가하면 되었는데, 업데이트 된 버전부터는 password 값을 hashed 데이터로 넣어달라고 에러를 리턴하더라구요.
previous the wireGaurd need to plain text password, but after the upgrade version, they need to put the hashed password in the environment. and if you sent not hashed password then they got a return from server
그래서 어떤식으로 제공하는지 에러 메세지에 나온 주소로 가봤는데, 해당 주소가 찾을수 없다는 에러가 리턴되었습니다. https://github.com/wg-easy/wg-easy/blob/master/How_to_generate_an_bcrypt_hash.md
so i access the page they mention in the error details, but the page is not exists. this is the page link they mention in the error details https://github.com/wg-easy/wg-easy/blob/master/How_to_generate_an_bcrypt_hash.md
그래서 Chatgpt를 통해 물어보니, 제가 bcrypt 를 통해 hashed 한 데이터를 PASSWORD_HASH environment에 세팅해주면 된다고 하더라구요.
so i ask to chatgpt about that issue, and they said if i use the self generated hash password using bcrypt package then it's would be working.
그래서 시도해본 결과, 서버는 잘 뜨는데, 어드민 페이지에서 로그인을 할려고 패스워드를 입력시 Error라는 401 에러가 리턴되었습니다. node로도 해보고 python으로도 해봐도 결과값은 Error 401이였습니다.
but after try that the result is still failed. the wiregaurd is working but i can't access the admin page with 401 error
그래서 wireGaurd 히스토리를 뒤진 결과 세팅하는방법을 https://github.com/wg-easy/wg-easy/commit/ddc7394e1b5efb251dba10bc448157d53c5f9297 해당 URL을 통해 찾았고, 아래 나와있는 커멘드를 통해 실행한 패스워드를 세팅한 결과 로그인일 잘 되는걸 확인했습니다.
so i search the github history and the find a way to solve the issue in below the link
https://github.com/wg-easy/wg-easy/commit/ddc7394e1b5efb251dba10bc448157d53c5f9297
and after follow the this instruction, it's working well.
테스트시 놓쳤던 부분은 결과값에서 나오는 ' 이 값까지 같이 env에 세팅을 해줘야 정상적으로 동작한다는 겁니다.
PASSWORD_HASH='hashed_password' 싱글 쿼더를 넣지 않은 경우 똑같이 패스워드를 못 찾는 이슈가 발생하빈다.
P.S) if you use the password get from the command, you must be put the single quote too in your environment value, if not it's not working
댓글
댓글 쓰기