"Ssh"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글
잔글
53번째 줄: 53번째 줄:
 
  scp -P 22 ~ hduser@node201.hadoop:/home/hduser/~<font face="sans-serif, Arial, Verdana, Trebuchet MS"><span style="white-space: normal;">
 
  scp -P 22 ~ hduser@node201.hadoop:/home/hduser/~<font face="sans-serif, Arial, Verdana, Trebuchet MS"><span style="white-space: normal;">
 
  </span></font>
 
  </span></font>
 +
 +
접속 차단
 +
<pre>vi /etc/ssh/sshd_config
 +
​    PermitRootLogin yes
 +
&nbsp;  PasswordAuthentication yes
 +
</pre>
 +
service ssh restart
  
 
== 참고 문헌 ==
 
== 참고 문헌 ==
 
[[Category:보안|Category:보안]][[Category:Linux]]
 
[[Category:보안|Category:보안]][[Category:Linux]]

2015년 10월 22일 (목) 09:25 판

ssh 사용법을 정리 합니다.

SSH 개요

SSH Key 관리

  • RSA 암호화 방식으로 공개키와 비밀키를 생성 합니다.
  • 암호화 방식 : rsa, dsa, rsa1
  • ~/.ssh/authorized_keys : Client의 공개키를 저장
  • ~/.ssh/id_rsa.pub : 공개키
  • ~/.ssh/id_rsa : 비밀키
  • ~/.ssh/known_hosts : SSH 방식으로 접속한 사용자 정보 저장
cd
### ssh-keygen -t rsa   : DSA 암호화 방식을 사용할 경우
ssh-keygen -t rsa
### Enter file in which to save the key (/home/hduser/.ssh/id_rsa): 비밀키를 저장할 파일 경로 입력
### Enter passphrase (empty for no passphrase): 비밀번호 입력 (자동 로그인을 원할 경우 enter 키를 누르세요)

chmod 700 ~/.ssh
chmod 644 ~/.ssh/*
chmod 600 ~/.ssh/id_rsa
  • Key를 다른 서버로 복사
ssh-copy-id -i ~/.ssh/id_rsa.pub  hduser@node201.hadoop.com
### ssh hduser@node201.hadoop.com 명령을 사용하여 암호 입력 없이 로그인 가능
  • Key를 다른 서버로 복사 2
scp ~/.ssh/id_rsa.pub hduser@node201.hadoop.com:aaa
### 다른 서버에서 아래 작업을 진행
cat aaa >> ~/.ssh/authorized_keys

사용자 매뉴얼

환경 설정 파일

  • /etc/ssh/sshd_config
  • /etc/hosts.allow
  • /etc/hosts.deny


명령어 실행

  • 원격 명령어 실행
ssh hduser@node201.hadoop.com "ls -alF"

파일 전송

  • 파일/폴더 전송
  • -P 포트
  • -r 하위 폴더도 모두 전송
scp -P 22 ~ hduser@node201.hadoop:/home/hduser/~

접속 차단

vi /etc/ssh/sshd_config
​    PermitRootLogin yes
    PasswordAuthentication yes

service ssh restart

참고 문헌