linux/rocky9.5 SSH접속 허용하기

IT
작성자
Ethan
작성일
2024-02-23 10:07
조회
4228

1. sshd 가 설치되어있는지 확인 (which 명령어 이용)
만약 설치가 되어 있지 않다면 yum을 이용해서 설치
yum install openssh-server
failed to download metadata for repo 'appstream' 에러 출력시 아래 내용 실행
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum update -y

2. 설치 완료 후 ssh config 파일 설정 - vi 편집기 이용
vi /etc/ssh/sshd_config
#Port 22 주석을 지워준 뒤, port 번호 수정

3. sercives file의 port number도 수정
vi /etc/services

4. sshd service 재시작
systemctl start sshd.socketrvice
혹시 에러가 뜬다면 ssh port 확인 semanage port -l | grep ssh
22로 되어 있다면 [port number] 수정 semanage port -a -t ssh_port_t -p tcp [port number]

5. 방화벽에 port number 추가
firewall-cmd --permanent --zone=public --add-port=[port number]/tcp
방화벽 재가동
firewall-cmd –-reload

sshd 재시작
systemctl restart sshd.service

6. 다른 컴퓨터에서 접속 확인
ssh 계정명@ip –p포트번호

전체 76
번호 제목 작성자 작성일 추천 조회
76
비밀글 123123
Ethan | 2025.02.03 | 추천 0 | 조회 4
Ethan 2025.02.03 0 4
75
레이드 카드(raid card) 제조사별 상태 확인
Ethan | 2025.01.16 | 추천 0 | 조회 50
Ethan 2025.01.16 0 50
74
비밀글 1234
Ethan | 2025.01.02 | 추천 0 | 조회 7
Ethan 2025.01.02 0 7
73
LINUX | MegaCli 사용법
Ethan | 2024.12.16 | 추천 0 | 조회 160
Ethan 2024.12.16 0 160
72
리눅스 명령어 모음
Ethan | 2024.10.29 | 추천 0 | 조회 252
Ethan 2024.10.29 0 252
71
리눅스 tar / tar.gz / zip 압축 및 압축 해제
Ethan | 2024.08.07 | 추천 0 | 조회 424
Ethan 2024.08.07 0 424
70
리눅스 서버 로그 확인 방법
Ethan | 2024.08.07 | 추천 0 | 조회 1004
Ethan 2024.08.07 0 1004
69
윈도우11 파일탐색기 더 많은 옵션 표시 끄기/켜기
Ethan | 2024.07.30 | 추천 0 | 조회 387
Ethan 2024.07.30 0 387
68
linux/ history 조회 시 날짜 시간 표시하기
Ethan | 2024.03.20 | 추천 0 | 조회 1296
Ethan 2024.03.20 0 1296
67
geoip 국가 코드 (geoip country code)
Ethan | 2024.03.20 | 추천 0 | 조회 458
Ethan 2024.03.20 0 458
66
linux/CentOS7 -> Rocky8,9 네트워크 설정 변경 내용
Ethan | 2024.03.16 | 추천 0 | 조회 1902
Ethan 2024.03.16 0 1902
65
linux/SSH - ssh no matching key exchange method found 에러 원인과 해결 방법
Ethan | 2024.03.11 | 추천 0 | 조회 3040
Ethan 2024.03.11 0 3040
64
rocky linux 8,9 네트워크 설정하기
Ethan | 2024.03.01 | 추천 0 | 조회 986
Ethan 2024.03.01 0 986
63
linux/rocky 남은 용량 확인 명령어
Ethan | 2024.02.23 | 추천 1 | 조회 1788
Ethan 2024.02.23 1 1788
62
linux/rocky9.5 SSH접속 허용하기
Ethan | 2024.02.23 | 추천 0 | 조회 4228
Ethan 2024.02.23 0 4228