로그인

검색

Extra Form

CentOS 7.9 최소설치 후 ssh 환경을 설정하기 

 

  1. CentOS 설치시 최소설치를 하더라도 ssh 는 기본 설치됨
    # systemctl status sshd
      // ssh 상태를 확인 
     
  2. ssh 포트를 변경하는 방법
    - /etc/ssh/sshd_config 파일을 수정 
    #Port 22 를 찾아서 주석을 해제하고 원하는 포트로 수정
    	
    	Port 13322

    - ssh 서비스 구동 
    # systemctl start sshd.service
     
  3. ssh 서비스 구동이 되지 않고 오류가 발생하는 경우
    Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.

    [방화벽 설정에서 포트를 사용하는 포트로 수정하여 열어줌]
    # firewall-cmd --permanent --zone=public --add-port=13322/tcp
    # firewall-cmd --reload

    # vi /etc/ssh/sshd_config
      
    #Port 22
    	   ... 위와 같이 주석 처리된 부분의 주석을 해제하고 원하는 포트로 수정
    	Port 13322

    # systemctl restart sshd
       // 서비스 재기동 

    - 서비스 재기동 중 여전히 오류가 발생하면 
    Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.

    // 아래와 같이 SELinux Policy Management tool 을 설치하고 포트를 등록해 줌

    # yum install policycoreutils-python

    # semanage port -l | grep ssh

    # semanage port -a -t ssh_port_t -p tcp 13322

    # semanage port -l | grep ssh

    # firewall-cmd --reload

    # systemctl start sshd

    # systemctl status sshd

이제 정상적으로 작동하는지 확이하면 됨. 

지금부터 Putty 로 ssh 접속할 수 있음. 

 

 

     4. Putty 접속시 root 계정에 곧바로 진입하지 못하도록 설정하려면 

 sshd_config 파일 중 아래와 같이 수정 

# PermitRootLogin yes
  ... 위와 같은 부분을 찾아서 아래처럼 수정
PermitRootLogin no


 


  1. 14
    Dec 2023
    13:37

    portainer 를 설치해 보자

    도커를 사용하려고 했더니 안내하는 사이트마다 portainer 를 이용하고 있다. 그래서 portainer를 우선 설치해 봤다. 🥽 시놀로지 나스에서 포테이너 설치방법 Synology Nas에 ssh로그인, root로 접속한다. 아래 명령으로 도커를 다운받도록 한다. # docker run...
    Read More
  2. 22
    May 2023
    13:47

    CentOS 기본 명령어 몇가지

    OS버전 확인> cat /etc/redhat-release 또는 cat /etc/*release* java 버전 확인> java -version 또는 javac -version [ 사용량 확인 하기 ] CPU 사용률> top -b -n1 | grep -Po '[0-9.]+ id' | awk '{print 100-$1}' 3.7 이렇게 결과가 나오면 사용률은 3.7% ...
    Read More
  3. 01
    Apr 2023
    19:12

    CentOS 7 최소설치 후 netstat 명령이 없는 경우

    CentOS 7 을 최소설치 한 경우 일부 명령이 설치되지 않을 수 있습니다. netstat 명령 입력시 not found 오류가 뜬다면 아래와 같이 net-tools 패키지를 설치해 준다 # yum install net-tools
    Read More
  4. 01
    Apr 2023
    19:09

    CentOS 7 에 MariaDB 설치하기

    CentOS 7 에 MariaDB 최신버전으로 설치하기 yum 을 업데이트 및 업그레이드 한다 # yum update # yum upgrade yum repository 등록으로 설치패키지 활성화 # vi /etc/yum.repos.d/MariaDB.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10...
    Read More
  5. 01
    Apr 2023
    18:33

    CentOS 7 에서 MariaDB 완전제거

    CentOS 에서 MariaDB를 완전하게 삭제하는 방법입니다. MariaDB 삭제하기 # yum remove -y mariadb mariadb-server ... 진짜냐고 물어오면? y ... 지원지면 Complete ! 기타 생성되었던 파일 삭제 # rm -rf /var/lib/mysql # rm /etc/my.cnf // DB 로그인 정보...
    Read More
  6. 01
    Apr 2023
    15:25

    CentOS 7.9 에 Apache 웹서버 설치하기

    CentOS 7.9 최소설치 버전에서 Apache 웹서버 구성방법 CentOS 의 업데이트를 최신으로 갱신합니다. # yum -y update Apache 웹서버를 설치합니다. # yum install httpd # systemctl start httpd // httpd 서비스 시작 # systemctl enable httpd // 운영체제 ...
    Read More
  7. 01
    Apr 2023
    14:29

    CentOS 7.9 최소설치시 ssh 구성 방법

    CentOS 7.9 최소설치 후 ssh 환경을 설정하기 CentOS 설치시 최소설치를 하더라도 ssh 는 기본 설치됨 # systemctl status sshd // ssh 상태를 확인 ssh 포트를 변경하는 방법 - /etc/ssh/sshd_config 파일을 수정 #Port 22 를 찾아서 주석을 해제하고 원하는 ...
    Read More
  8. 01
    Apr 2023
    13:20

    CentOS 7.9 최소설치시 네트워크 설정 방법

    CentOS 7.9 를 최소설치하여 웹서버 구성하는 방법입니다. 최소설치를 완료한 이후 ip설정 완료된 이후 부터 작업입니다. ip 확인 방법 # hostname -i // 맥주소와 ip를 나타냄 # hostname -I // 대문자 i, 아이피 주소만 나타냄 # ip addr show # ip addr // ...
    Read More
  9. 31
    Mar 2023
    14:30

    CentOS 에서 MariaDB 설치하기

    CentOS 버전 확인 > cat /etc/*release https://mariadb.org/download/?t=repo-config 에서 OS버전 및 설치하고자 하는 MariaDB 버전에 따라 Repository 정보와 설치 명령어를 안내 받을 수 있다. repository 정보를 수정하여 설치를 준비한다. > vi /etc/yum....
    Read More
Board Pagination Prev 1 2 Next
/ 2