· 톺아보기

질문

[해결] Rclone 구글드라이브 인증이 안됩니다. (신규 인증하시는분 참고하세요.)

도키도키76 · · 수정

조회 7,345 · 공감 1 · 댓글 19

안녕하세요? 시놀에서 rclone을 이용해 Google Drive를 연결해 잘 쓰고 있습니다.

rclone 버전은 1.57로 1년째 잘쓰고 있었는데 갑자기 토큰이 expire 또는 revoke 됐다고 연결이 끊어져 버렸습니다.

그래서 rclone 최신 버전인 1.58.1로 버전을 올리고 기존에 있던 remote를 삭제 후 다시 생성을 하려는데

마지막단의 구글 인증이 되질 않고 있습니다.

아래에서 "N"을 누르면 인증을 하는 경로가 나오고 브라우저에 붙여서 인증을 하는것으로 알고 있는데

인증하는 주소가 나오질 않고 config_token을 넣어라고만 나오고 있습니다.

어떻게 인증을 할 수 있을까요?


Use auto config?

 * Say Y if not sure

 * Say N if you are working on a remote or headless machine


y) Yes (default)

n) No

y/n> n

Option config_token.

For this to work, you will need rclone available on a machine that has

a web browser available.

For more help and alternate methods see: https://rclone.org/remote_setup/

Execute the following on the machine with the web browser (same rclone

version recommended):

        rclone authorize "drive" "***********************************************"

Then paste the result.

Enter a value.

config_token> 


------ 전체 ---------------------------------------------------------------------------------------------------------------------------

name> GD

Option Storage.

Type of storage to configure.

Choose a number from below, or type in your own value.

 ......

17 / Google Drive

   \ (drive)

......

Storage> 17

Option client_id.

Google Application Client Id

Setting your own is recommended.

See https://rclone.org/drive/#making-your-own-client-id for how to create your own.

If you leave this blank, it will use an internal key which is low performance.

Enter a value. Press Enter to leave empty.

client_id> ********

Option client_secret.

OAuth Client Secret.

Leave blank normally.

Enter a value. Press Enter to leave empty.

client_secret> *******

Option scope.

Scope that rclone should use when requesting access from drive.

Choose a number from below, or type in your own value.

Press Enter to leave empty.

 1 / Full access all files, excluding Application Data Folder.

   \ (drive)

 2 / Read-only access to file metadata and file contents.

   \ (drive.readonly)

   / Access to files created by rclone only.

 3 | These are visible in the drive website.

   | File authorization is revoked when the user deauthorizes the app.

   \ (drive.file)

   / Allows read and write access to the Application Data folder.

 4 | This is not visible in the drive website.

   \ (drive.appfolder)

   / Allows read-only access to file metadata but

 5 | does not allow any access to read or download file content.

   \ (drive.metadata.readonly)

scope> 1

Option root_folder_id.

ID of the root folder.

Leave blank normally.

Fill in to access "Computers" folders (see docs), or for rclone to use

a non root folder as its starting point.

Enter a value. Press Enter to leave empty.

root_folder_id> 

Option service_account_file.

Service Account Credentials JSON file path.

Leave blank normally.

Needed only if you want use SA instead of interactive login.

Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.

Enter a value. Press Enter to leave empty.

service_account_file> 

Edit advanced config?

y) Yes

n) No (default)

y/n> n

Use auto config?

 * Say Y if not sure

 * Say N if you are working on a remote or headless machine


y) Yes (default)

n) No

y/n> n

Option config_token.

For this to work, you will need rclone available on a machine that has

a web browser available.

For more help and alternate methods see: https://rclone.org/remote_setup/

Execute the following on the machine with the web browser (same rclone

version recommended):

        rclone authorize "drive" "***********************************************"

Then paste the result.

Enter a value.

config_token> 


-------------------------------------해결방안----------------------------------------------------------

1. Rclone 1.58.1 부터는 인증방식이 변경 되었습니다.

2. Use Auto Config (N)을 하면 예전에는 인증주소가 나왔는데 1.58.1 부터는 외부클라이언트에서 별도 인증을 해줘야 합니다.

   Use Auto Config (N)을 선택하면 인증시 필요한 명령어가 안내 됩니다... (rclone authorize "drive" "***********************************************")

3. 일단 윈도우용 Rclone을 따로 설치하고 여기에 위 설치 된 Rclone 경로에서 rclone authorize "drive" "***********************************************" 를 실행 합니다.

4. 그러면 웹브라우저 팝업으로 인증창이 나오는데 아래 오류가 나서 진행이 되질 않으실 겁니다.

    "승인 오류
     400 오류: invalid_request
     Localhost URI is not allowed for 'NATIVE_DEVICE' client type. "

5. 이 오류를 해결하기 위해서는 Google API에 Redirect URI가 설정되어야 합니다.

    인터넷에서 Google API의 OAuth 클라이언트 ID 생성 시 애플리케이션 유형을 보통 "TV 및 입력제한기기"로 하셨을텐데 

    이 부분을 "웹애플리케이션"으로 바꿔주고, 밑에 있는 승인된 리디렉션 URI 항목에 "http://127.0.0.1:536821"을 

    추가해 주셔야 합니다.

6. 위 설정이 완료 되고 윈도우에서 rclone authorize "drive" "***********************************************"를

   실행하고 정상적으로 인증창이 나오고 인증이 완료되면, 윈도우 CMD 화면에 코드값이 나옵니다.

7. 이 코드값을 설정하고 있는 NAS 인증쪽에 있는 config_token 프롬프트에 붙여주시고 다음단계를 진행하시면 끝 입니다.

댓글 19

  1. 병따개님 ·
    마지막에 영어로 나오는 메세지대로 따라하면 되요
  2. 도키도키76 ·
    @병따개님님 rclone authorize "drive" "***********************************************"
    이걸하면 Use auto config?에서 y 한것과 같은 http://127.0.0.1:53682/로 인증하라고 나오는데
    이 주소를 넣으면 "127.0.0.1에서 연결을 거부했습니다"라는 메시지가 나옵니다. 방법이 있을까요?

    2022/06/22 09:37:27 NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
    2022/06/22 09:37:27 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=*******************
    2022/06/22 09:37:27 NOTICE: Log in and authorize rclone for access
    2022/06/22 09:37:27 NOTICE: Waiting for code...
  3. 병따개님 ·
    @도키도키76님
    For this to work, you will need rclone available on a machine that has a web browser available.

    For more help and alternate methods see: https://rclone.org/remote_setup/

    Execute the following on the machine with the web browser (same rclone version recommended):

    이 메세지만 잘 보고 따라하면 쉽게 되는지라 오전에 바빠서 간단하게만 답변 달았는데 다행히 잘 해결하셨네요 ㅎㅎ
  4. 후훗후 ·
    그거 그냥 y하세요 저도 한참 해맸음..
    /Vollago
  5. 도키도키76 ·
    @후훗후님
    y하면 이렇게 나오는데요.... 이후 어떻게 인증해야 하나요????
    http://127.0.0.1:53682/auth?state=********** 주소 들어가면 연결 거부 메세지 나옵니다.
    커스텀 config에서 리다이렉트 URL을 "http://127.0.0.1:53682/"로 설정하라는 것 같은데 어떻게 할지 모르겠습니다.

    2022/06/22 09:48:33 NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
    2022/06/22 09:48:33 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=**********
    2022/06/22 09:48:33 NOTICE: Log in and authorize rclone for access
    2022/06/22 09:48:33 NOTICE: Waiting for code...
  6. 후훗후 ·
    도키도키76님// 어,, 저는 다이렉트로 페이지 연결 되었던거 같은데요,,
    /Vollago
  7. 도키도키76 ·
    @후훗후님 Localhost URI is not allowed for 'NATIVE_DEVICE' client type. 라고 나오는데 난감하네요...
  8. 콜라맛홍삼 ·
    저는 이것저것 열심히 해맨 끝에 맥용 rclone을 받아서 설정했습니다.
    그리고 그 conf 파일만 나스에 넣어줬어요.
  9. 파랑동네 ·
    원격 서버의 127.0.0.1접속이 안되는게 맞아요~(127.0.0.1은 서버 자신) 접속하시는pc(지금 쓰고 있는pc)에서 rclone설치 하시고 key값 받아서 연결 완료 하시면 됩니다
    *다른방법은 127.0.0.1에 노출 되는 포트 임시로 열서어 접근 하셔도 됩니다
  10. 도키도키76 ·
    @파랑동네님 와~~~ 어렵게 해결했습니다. 1.58.1로 바뀌고 구글정책이 바뀐듯 합니다....
    위에 다시 설명하겠습니다...
  11. theb1ue ·
    윈도우에 rclone 설치하고 cmd에서 rclone 폴더로 이동,
    rclone authorize "drive" "***********************************************"
    입력하고 브라우저 통해 인증, 인증 후 rclone token 코드 복사
    시놀 rclone config 구글 드라이브 연동 시 해당 토큰 코드 입력하면 됩니다.
  12. 도키도키76 ·
    @theb1ue님 와~~~ 어렵게 해결했습니다. 1.58.1로 바뀌고 구글정책이 바뀐듯 합니다....
    위에 다시 설명하겠습니다...
  13. theb1ue ·
    @도키도키76님 도키도키님이 진행하신 해결 방법 5번을 저도 비슷하게 진행했던 거 같은데 댓글에는 빼먹었네요. 해결 되셨다니 다행입니다.
  14. jerry80 ·
    에고 복잡해라.. 1.57 로 잘 되고 있는데 1.58.1 로 올리면 위 과정대로 다시해야 할까요 ? 그냥 올리지 않는게 정답인것 같네요. ㅠㅠ
  15. prop ·
    @Superium님 제가 어제만해도 그냥 기존방법대로 했는데.. 낮은 버전 쓰면 아직 되는게 아닐까 싶습니다
  16. 도키도키76 ·
    @jerry80님 이전 버전에서 받은 유효한 토큰이 있을 경우 1.58.x로 올리면 잘 동작하는것 같습니다. 새로 토큰 생성시 문제가 되는데 아마 곧 기존 토큰이 만료 되실듯 합니다.
  17. prop ·
    @Superium님 에고 확인까지 해주셨군요. 저도 슬슬 바꿔나가야겠네요
  18. jerry80 ·
    @도키도키76님 그렇군요. 어제 그렇지 않아도 다른 리눅스 머신에 이치로님 rclone 도커버전 최신으로 설치하고 기존의 rclone.conf 파일 복사했더니 잘 되기에.. 기존꺼 있으면 상관없구나.. 라고 생각했었는데 이게 만료가 되는 군요.

    바로 사용하지 않는 머신에서 새로 생성해서 해봐야 하겠습니다.
  19. 20eung ·
    ssh tunnel 방법으로도 가능합니다.
    PC에서 nas로 ssh 터널 접속 후 pc에서 웹브라우저로 http://127.0.0.1:53682 주소로 접속하면 됩니다.

    ssh -L 53682:127.0.0.1:53682 nas_id@nas_ip

나스당 최근 글

나스당 목록 더 보기