[Ubuntu] SSH Server 설치.
- 설치한 배포판 버전 : Ubuntu Server 12.04.05
설치된 패키지 목록을 확인하려면
$ dpkg -l
너무 많은 목록이 나오기 때문에 ssh 관련 목록만 확인해 보자.
$ dpkg -l |grep ssh
root@ubuntu:/etc/ssh# dpkg -l | grep ssh
ii openssh-client 1:5.9p1-5ubuntu1.4 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:5.9p1-5ubuntu1.4 secure shell (SSH) server, for secure access from remote machines
ii ssh-import-id 2.10-0ubuntu1 securely retrieve an SSH public key and install it locally
설치가 되지 않은 경우라면 설치,
$ sudo apt-get install openssh-server
데몬이 잘 동작하는지 확인하자...ssh 기본 포트는 22이다.
$ netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
---------------------------------------------------------------------------------------------------------
## ssh 서버 재시작
$ sudo /etc/init.d/ssh restart
## ssh포트변경
아래 파일을 열어서 포트를 변경하면 된다.
$ sudo vi /etc/ssh/sshd_config