sshd에서 KeyRegenerationInterval 확인 방법

sjh0320의 이미지

sshd server에 KeyRegenerationInterval field를 제어해서 동작을 확인하고

싶습니다.sshd_config 에 다음과 같이 설정하고 Server를 재구동 시켰습니다.

그런데, 어떤 변화도 없는것 처럼 보이는데, KeyRegenerationInterval를 확인할 수 있는

방법을 혹시 알고 계신분 있으신가요?

Manual에는 KeyRegenerationInterval 값이 새로운 키 재생성에 대한 간격을

설정하는 것이라고 나와있는데요.. 600초 이하는 안되는것인지?


Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 2
#ServerKeyBits 768
......

/etc/init.d/ssh 에는 다음과 같이 script file을 생성했습니다.

#! /bin/sh
#
# chkconfig: 2345 20 20
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
set -e

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

# Autokeygen control is located in /etc/default/ssh
. /etc/default/ssh

# Uncomment the following line to allow the script to autogenerate
# the required keys if they are not on the system.
AUTOKEYGEN=yes

test -x /usr/sbin/sshd || exit 0
( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0

if test -f /etc/default/ssh; then
. /etc/default/ssh
fi

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
echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)"
exit 0
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
}
setupKeys()
{
if [ ! -s /etc/ssh/ssh_host_key ]; then
/usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N "" -t rsa1
chmod 700 /etc/ssh/ssh_host_key
fi
if [ ! -s /etc/ssh/ssh_host_rsa_key ]; then
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_rsa_key -N "" -t rsa
chmod 700 /etc/ssh/ssh_host_rsa_key
fi
if [ ! -s /etc/ssh/ssh_host_dsa_key ]; then
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N "" -t dsa
chmod 700 /etc/ssh/ssh_host_dsa_key
fi
}

checkKeys()

{
if [ ! -s /etc/ssh/ssh_host_key ]; then
echo "ssh_host_key does not exist: generating new key:"
ssh-keygen -t rsa -f /etc/ssh/ssh_host_key -N ""
fi
if [ ! -s /etc/ssh/ssh_host_rsa_key ]; then
echo "ssh_host_rsa_key does not exist: generating new key:"
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key -N ""
fi
if [ ! -s /etc/ssh/ssh_host_dsa_key ]; then
echo "ssh_host_dsa_key does not exist: generating new key:"
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
fi
}

case "$1" in
start)
check_for_no_start
check_privsep_dir
# [ "$AUTOKEYGEN" = yes ] && setupKeys
# echo -n "Starting OpenBSD Secure Shell server: "
checkKeys
echo -n "sshd"
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS
echo "."
;;
stop)
echo -n "Stopping OpenBSD Secure Shell server: sshd"
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid
echo "."
;;

reload|force-reload)
check_for_no_start
check_config
echo -n "Reloading OpenBSD Secure Shell server's configuration"
start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/s
shd
echo "."
;;

restart)
check_config
echo -n "Restarting OpenBSD Secure Shell server: sshd"
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid
check_for_no_start
check_privsep_dir
sleep 2
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS
echo "."
;;

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

exit 0

modestcode의 이미지

Quote:
sshd server에 KeyRegenerationInterval field를 제어해서 동작을 확인하고

싶습니다.sshd_config 에 다음과 같이 설정하고 Server를 재구동 시켰습니다.

그런데, 어떤 변화도 없는것 처럼 보이는데, KeyRegenerationInterval를 확인할 수 있는

방법을 혹시 알고 계신분 있으신가요?

LogLevel VERBOSE
로 하면 로그에 찍을 것 같습니다.

Quote:
600초 이하는 안되는것인지?

가능할 것입니다. 기본값이 3600초인데 2초는 과해 보이네요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.