[OS_Linux_Ubuntu] telnet & ssh 설치와 설정 (installation / configuration)


1. telnet 설치 및 설정
sudo apt-get install xinetd
sudo apt-get install telnetd

/etc/xinetd.conf 파일의 defualt{} 함수는 주석 처리

service telnet
{
     disable = no
     flags = REUSE
     socket_type = stream
     wait = no
     user = root
     server = /usr/sbin/in.telnetd
     log_on_failure += USERID
}

sudo /etc/init.d/xinetd restart


2. ssh 설치 및 설정
설치

    $ sudo apt-get install ssh

포트 변경

    $ sudo vim /etc/ssh/sshd_config

    # port 22 에서 '#' 를 제거하고 원하는 포트로 변경

    IF >>  X-window 사용하고 싶을 경우, 
        
        /etc/ssh/ssh_config
        위의 파일의 다음내용을 변경한다
       
        # ForwardX11 no -> ForwardX11 yes 로 설정변경)

데몬 재시작

    $ sudo /etc/init.d/ssh restart

서버 작동 확인

    $ netstat -ntlp | grep 23



Ubuntu는 /etc/hosts.allow 파일과  /etc/hosts.deny 파일에 모든 서비스에 대한 허용과 거절을 설정한다. 
설정 예시>  hosts.deny 파일에는 보통 ALL : ALL 로 해준다.(보안의 기본 정책은 모든 접속을 차단하고 승인된 IP만 허용한다)
  서비스(ssh/telnet)을 우분투 서버가 있는 네트워크(192.168.123.0/24)와 관리자 IP(10.10.10.100)을 허용하고자 한다면 
  hosts.deny 는 
     ALL : ALL

  hosts.allow 은
     sshd : 10.10.10.100, 192.168.123.0/255.255.255.0
     in.telnetd : 10.10.10.100, 192.168.123.0/255.255.255.0 

상기와 같이 설정한다.
로컬에서 로컬로의 모든 접속을 허용하려면  hosts.allow 파일에  ALL:localhost 를 추가 해주면 된다.

댓글

이 블로그의 인기 게시물

Delete topic on Kafka, 카프카 토픽 삭제하기

Chromium 개발 환경 세팅, 크로미움 개발 준비하기

To download a file from MinIO using Spring Boot, 스프링부트 Minio 사용하기

How to change java version on gradle of flutter

Sorting a list in python

Develop a Kafka producer to send messages to a Kafka topic

AttributeError: module 'numpy' has no attribute 'float'

What are 5 creative things I could do with my kids' art, 아이와 함께하는 창의적 놀이

Sort the distinct values by their count in descending order using the DataFrame API

10 Python Functions Every Data Scientist Must Memorize