![mkdir: '.ssh' 디렉터리를 생성할 수 없습니다: ssh-copy-id에 대한 권한이 거부되었습니다.](https://linux55.com/image/193327/mkdir%3A%20'.ssh'%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4%3A%20ssh-copy-id%EC%97%90%20%EB%8C%80%ED%95%9C%20%EA%B6%8C%ED%95%9C%EC%9D%B4%20%EA%B1%B0%EB%B6%80%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
┌─╼ [~/Downloads]
└╼ ssh-copy-id -i ~/.ssh/id_ed25519 my_username@server
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/infinity/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
my_username@server's password:
Could not chdir to home directory /gel/usr/my_username: No such file or directory
sh: line 0: cd: /gel/usr/my_username: No such file or directory
mkdir: cannot create directory ‘.ssh’: Permission denied
서버에 연결했지만 연결할 수 없습니다 my_username
. /gel/usr
이 문제를 해결할 수 있는 해결 방법이 있습니까? 이 문제를 해결하기 위해 어떤 방식으로든 서버에서 $PATH를 수정할 수 있습니까?
답변1
오류 줄에서 알 수 있듯이 이 위치에는 홈 디렉터리가 없습니다.
Could not chdir to home directory /gel/usr/my_username: No such file or directory
/home/
예를 들어, 일반적으로 홈 디렉터리는 /home/username
.
파일을 직접 편집 /etc/passwd
하고 올바른 기존 경로를 입력하거나 명령을 사용하여 usermod
아래와 같이 홈 디렉터리를 변경할 수 있습니다.
usermod -d /home/username username
상황에 맞게 사용자 이름의 인스턴스를 변경해야 합니다.