Ubuntu server ssh



 [원격접속 환경 구성]
 sshd ( 원격 접속 데몬 ) 설치와 실행
morenice@ubuntu:~$ sudo apt-get install ssh
morenice@ubuntu:~$ sudo /etc/init.d/ssh start
 * Starting OpenBSD Secure Shell server sshd                               [ OK ]

시작프로그램 등록
/etc/rc.local에 등록하여 부팅 때 마다 ssh 서버를 실행되도록 설정.    
morenice@ubuntu:/etc$ sudo vi /etc/rc.local


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# start ssh server
/etc/init.d/ssh start
exit 0


[원격 소프트웨어 Putty]
  http://www.putty.org/  Free 다운로드
 윈도우 환경의 개발에서 리눅스에 원격 접속을 하기 위한 소프트웨어로서, 원격 접속 할 대상의 서버에서는 sshd 라는 원격 접속 데몬이 실행 되어 있어야 원격접속이 가능하다.
[Putty를 사용하여 원격 접속하기]
 대상 서버의 IP가 필요함으로 윈도우에서는 ipconfig 리눅스에서는 ifconfig 명령어를 사용하여, IP정보를 얻어야 함.

morenice@ubuntu:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:22:73:EF
          inet addr:192.168.194.130  Bcast:192.168.194.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe22:73ef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6442 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8718304 (8.3 MiB)  TX bytes:640496 (625.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)



※ 'Connection Refused' 등의 메세지와 함께 접속이 실패하는 경우는 서비스가 실행되지 않았을 가능성이 있다.

   'ps -ef | grep sshd' 명령어를 사용하여 대상 리눅스의 sshd 데몬의 실행 유무를 확인한다. 만약 실행되지 않았을 경우는 '/etc/init.d/ssh start'로 sshd 데몬 서비스 실행한다.

   서비스가 실행 중이라면 방화벽에서 허용이 되어 있지 않을 수 있으니  'iptables -L' 명령어를 사용하여 방화벽 설정을 확인한다.

   조금 위험하지만 'iptables -F' 명령어로 방화벽을 모두 해제할 수 있다.

Popular posts from this blog

youtube download

com.gpki.secureweb.GPKISecureWEBException: ErrCode=1507,ErrMsg=[GPKI_CMS_ProcessEnvelopedData] 해당 인증서로는 데이터를 풀 수 없습니다.

rexpert 공식필드(javascript) 점검일 주기 계산