본문 바로가기
컴퓨터 활용(한글, 오피스 등)/50_2.운영체제_리눅스

우분투_SSH 서비스, 서비스 자동 실행

by 3604 2022. 10. 21.
728x90

SSH 서비스 및 서비스 자동 실행


1. 수동 방식


 가. 기동 방법서버측

     service ssh start

 나. 원격접속 프로그램에서 접속

     예: putty를 이용하여 ssh로 접속


2 자동 방식

 가.  우분투에서 재기동 시 서비스 자동 실행 명령어

  ㅁ 우분투 18.04     

     $sudo systemctl enable 서비스이름.service


 나. 사용법

  ㅁ ssh 서비스 자동 실행 등록

     $sudo systemctl  enable ssh.service

 다 오류 해결

  ㅁ 서비스 자동 실행 등록 시 오류1

    - 오류 내용
      System has not been booted with systemd as init system (PID 1). Can't operate.
      Failed to connect to bus: Host is down

    - 해결 방법

      $sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
      $sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
      $exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
      $snap version

참고

1. https://3604.tistory.com/manage/newpost/113?type=post&returnURL=https%3A%2F%2F3604.tistory.com%2F113
2. https://tigercoin.tistory.com/254
3. https://gist.github.com/alyleite/ca8b10581dbecd722d9dcc35b50d9b2b

728x90