![쉘 스크립트에서 비밀번호를 읽으라는 메시지를 표시할 수 없습니다.](https://linux55.com/image/127624/%EC%89%98%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%97%90%EC%84%9C%20%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8%EB%A5%BC%20%EC%9D%BD%EC%9C%BC%EB%9D%BC%EB%8A%94%20%EB%A9%94%EC%8B%9C%EC%A7%80%EB%A5%BC%20%ED%91%9C%EC%8B%9C%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
아래 스크립트에서는 입력을 기다리지 않고 passwd
오류 메시지로 끝납니다.
$ sudo ssh -i crowdpersona_key [email protected] bash -c ' git clone [email protected]/test1/crowdpersona.git && cd crowdpersona && mkdir attachments'
Error message : fatal: could not read Password for 'https://[email protected]': No such device or address
답변1
ssh 명령에서는 -i를 사용할 필요가 없거나 사용하고 싶지 않습니다.
-i 공개 키 인증에 사용되는 ID(개인 키)를 읽을 파일을 선택합니다.
바라보다
man ssh
귀하의 명령은 작동합니다 :
sudo ssh [email protected] bash -c ' git clone https://[email protected]/test1/crowdpersona.git && cd crowdpersona && mkdir attachments'
답변2
[email protected]/test1/crowdpersona.git
유효한 GitHub 프로젝트 URL이 아닐 수 있습니다. [email protected]:user/project.git
SSH를 통한 Git과 작동하거나 https://github.com/user/project.git
HTTPS를 통한 Git과 작동 합니다 . 존재하지 않는 프로젝트 URI가 표시되면 GitHub는 인증을 요청합니다(개인 저장소를 찾기 위해).
$ git clone https://github.com/foo/bar.git
Cloning into 'bar'...
Username for 'https://github.com':
TTY가 할당되지 않았기 때문에 명령 git
이 여기서 비밀번호나 사용자 이름을 읽을 수 없습니다.
$ git clone https://github.com/foo/bar.git
Cloning into 'bar'...
Username for 'https://github.com': ^C
$ ssh localhost git clone https://github.com/foo/bar.git
Cloning into 'bar'...
fatal: could not read Username for 'https://github.com': No such device or address
해결책은 일반적으로 올바른 프로젝트 URI를 사용하는 것입니다.