# ssh 서버 설치
apt install -y openssh-server
# 설정파일
sudo vi /etc/ssh/sshd_config
# root login 차단
PermitRootLogin no
## Port 22
Port 3022
# 공개키로 인증
PubkeyAuthentication yes
chmod g-w /home/$USER
chmod 700 /home/$USER/.ssh
chmod 600 /home/$USER/.ssh/authorized_keys
# 암호 인증 막기
PasswordAuthentication no
# 모드 변경
StrictModes no
# 공개키
AuthorizedKeysFile .ssh/authorized_keys
# 데몬 재구동
sudo systemctl restart sshd (Centos)
sudo systemctl restart ssh (Ubuntu)
# ssh 접속
ssh -o StrictHostKeyChecking=no -p 3322 linux_user@10.10.10.10
'Infra Structure > Linux' 카테고리의 다른 글
[Centos] NFS 설정 (0) | 2022.07.10 |
---|---|
[Linux] 쉘 실행시 내부에서 패스워드 입력 (0) | 2022.07.04 |
리눅스 계정 추가 (0) | 2022.06.13 |
ssh key 생성(원격서버접속) (0) | 2022.06.12 |
[Linux] ps -aux --forest | grep nginx (0) | 2022.06.01 |