[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 를 추가 해주면 된다.

댓글

이 블로그의 인기 게시물

CDPEvents in puppeteer

Using the MinIO API via curl

How to split a list into chunks of 100 items in JavaScript, 자바스크립트 리스트 쪼개기

Declaration of custom object or type in Node.js

HTML Inline divisions at one row by Tailwind

Boilerplate for typescript server programing

How to checkout branch of remote git, 깃 리모트 브랜치 체크아웃

Gradle multi-module project

가속도 & 속도

Sparse encoder