Linux에서 비밀번호를 사용하지 않고 원격 로그인

Linux에서 비밀번호를 사용하지 않고 원격 로그인

저는 Linux 운영 체제를 처음 사용합니다. 저는 레드햇 리눅스를 사용하고 있습니다.

비밀번호를 제공하지 않고 원격 서비스를 사용하여 원격 컴퓨터에 로그인하는 방법을 알려주실 수 있나요?

Linux에 명령이 있습니까? 아니면 'C' 코드를 작성해야 합니까?

답변1

코드를 작성할 필요는 없습니다.

먼저 키 쌍을 생성하십시오.

ssh-keygen

둘째, ssh-copy-id를 사용하여 공개 키를 배포하세요.

ssh-copy-id username@remote-machine

이 명령을 실행할 때 비밀번호를 제공해야 합니다. 그 후에는 비밀번호 없이 원격 시스템에 로그인할 수 있습니다.

다음은 매뉴얼 페이지의 명령에 대한 몇 가지 설명입니다.

ssh-keygen

 ssh-keygen generates, manages and converts authentication keys for
 ssh(1).  ssh-keygen can create RSA keys for use by SSH protocol version 1
 and DSA, ECDSA or RSA keys for use by SSH protocol version 2.  The type
 of key to be generated is specified with the -t option.  If invoked with-
 out any arguments, ssh-keygen will generate an RSA key for use in SSH
 protocol 2 connections.

SSH-복사-ID

 ssh-copy-id  is  a  script  that  uses  ssh  to  log into a remote machine
 and append the indicated identity file to that machine's
 ~/.ssh/authorized_keys file.

답변2

로컬 시스템에 개인 부분을 저장하고 원격 시스템에 공개 부분을 저장하는 공개 키 쌍을 사용하여 로그인을 인증할 수 있는 ssh를 살펴보세요.

관련 정보