기술 노트/ubuntu

sshd 서비스 설치

미래의억만장자 2023. 11. 29. 19:24

우분투를 설치하면 sshd 서비스가 없어서, 설치 및 활성화를 해야 하네요.

 

 

설치

sudo apt install openssh-server

 

설정 변경

vi /etc/ssh/sshd_config

 

아래의 Port 및 ListenAddress 주석 해제

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Include /etc/ssh/sshd_config.d/*.conf

Port 22  #<- 해당 라인 주석 해제
#AddressFamily any
ListenAddress 0.0.0.0 #<- 해당 라인 주석 해제
#ListenAddress ::

 

서비스 재시작

sudo  systemctl restart sshd