mkdir: '.ssh' 디렉터리를 생성할 수 없습니다: ssh-copy-id에 대한 권한이 거부되었습니다.

mkdir: '.ssh' 디렉터리를 생성할 수 없습니다: ssh-copy-id에 대한 권한이 거부되었습니다.
┌─╼ [~/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

상황에 맞게 사용자 이름의 인스턴스를 변경해야 합니다.

관련 정보