[問題] 更新3.2.0-37 kernel後 ssh 怪怪的
這件事情發生在昨天
我更新完3.2.0-37的kernel後
發現在開機後不登入桌面或是CLI的狀況下
用ssh遠端連線到機器
會顯示ssh: connect to host a.b.c.d port xxxxx: No route to host
一直要到機器的CLI登入後或是桌面登入後
遠端ssh連過來機器才會看到要求輸入密碼的畫面
不知道是出了什麼問題
理論上就算沒有進桌面
沒有登入CLI
遠端是可以直接ssh連線進來的不是嗎?
by the way.....
機器是ASUS F9E
OS版本是Mint 13 KDE
Thanks for everybody's help :D
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.243.3.147
→
02/09 00:58, , 1F
02/09 00:58, 1F
um.....我平常是有在用fedora
但是fedora我只用在file server
有桌面需求我大多都用mint
不好意思造成您的誤會 <( _ _ )>
→
02/09 09:45, , 2F
02/09 09:45, 2F
誒....這台的防火牆前端設定程式我是用ufw
而且我沒有裝ufw的GUI
之前本地端沒有登入也可以從遠端登入沒問題
→
02/09 09:45, , 3F
02/09 09:45, 3F
→
02/09 09:50, , 4F
02/09 09:50, 4F
um...在換kernel前他本地端還沒登入就會跑DHCP了
而且也有辦法遠端連線
→
02/09 09:54, , 5F
02/09 09:54, 5F
我在更新的時候
他確實有問我要不要更換新版本的script
似乎路徑是在/etc底下
或許跟您說的有關
那....如果是這樣的話
我應該怎麼把ssh連線的設定改回來呢?
先謝謝各位了
推
02/10 09:23, , 6F
02/10 09:23, 6F
內容是以下
#! /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:
# 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 || exit 0
( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
chrooted() {
# borrowed from udev's postinst
# and then borrowed from initramfs-tools's preinst
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)"
]; then
# the devicenumber/inode pair of / is the same as that of
# /sbin/init's root, so we're *not* in a chroot and hence
# return false.
return 1
fi
return 0
}
# The init.d script is only for chroots
if [ -e /etc/init/ssh.conf ] && ! chrooted; then
exec /lib/init/upstart-job ssh "$@"
fi
umask 022
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 || true
fi
if ! run_by_init; then
log_action_msg "OpenBSD Secure Shell server not in use
(/etc/ssh/sshd_not_to_be_run)" || true
fi
exit 0
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!" || true
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 $SSHD_OPTS -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" || true
if start-stop-daemon --start --quiet --oknodo --pidfile
/var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
stop)
log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
if start-stop-daemon --stop --quiet --oknodo --pidfile
/var/run/sshd.pid; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
reload|force-reload)
check_for_no_start
check_config
log_daemon_msg "Reloading OpenBSD Secure Shell server's
configuration" "sshd" || true
if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile
/var/run/sshd.pid --exec /usr/sbin/sshd; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
restart)
check_privsep_dir
check_config
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" ||
true
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 || true
else
log_end_msg 1 || true
fi
;;
try-restart)
check_privsep_dir
check_config
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" ||
true
RET=0
start-stop-daemon --stop --quiet --retry 30 --pidfile
/var/run/sshd.pid || RET="$?"
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 || true
else
log_end_msg 1 || true
fi
;;
1)
# daemon not running
log_progress_msg "(not running)" || true
log_end_msg 0 || true
;;
*)
# failed to stop
log_progress_msg "(failed to stop)" || true
log_end_msg 1 || true
;;
esac
;;
status)
status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && exit 0 ||
exit $?
;;
*)
log_action_msg "Usage: /etc/init.d/ssh
{start|stop|reload|force-reload|restart|try-restart|status}" || true
exit 1
esac
exit 0
→
02/11 11:14, , 7F
02/11 11:14, 7F
→
02/11 11:15, , 8F
02/11 11:15, 8F
kdjf兄不好意思我看錯了 XDD
# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.
description "OpenSSH server"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
# 'sshd -D' leaks stderr and confuses things in conjunction with 'console
log'
console none
pre-start script
test -x /usr/sbin/sshd || { stop; exit 0; }
test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
test -c /dev/null || { stop; exit 0; }
mkdir -p -m0755 /var/run/sshd
end script
# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D
※ 編輯: fedora 來自: 111.243.1.204 (02/12 00:26)
→
02/12 07:18, , 9F
02/12 07:18, 9F
查到的是這些
/etc
/etc/issue.dpkg-old
/etc/bash_completion.d
/etc/dpkg/origins
/etc/xdg/autostart
/etc/init
/etc/kernel/postrm.d
/etc/kernel/postinst.d
/etc/profile
/etc/update-motd.d
/etc/update-motd.d/10-help-text
/etc/logrotate.d
/etc/mtab
/etc/apparmor.d
/etc/gnome/defaults.list
/etc/legal
/etc/kde4rc
/etc/init.d
/etc/issue.net
/etc/pm/sleep.d
/etc/lsb-release
/etc/cron.daily
/etc/cron.daily/google-chrome
/etc/apt
/etc/apt/trusted.gpg
/etc/ld.so.cache
/etc/firefox
/etc/linuxmint/mintSystem.conf
/etc/apport/blacklist.d
/etc/apport/native-origins.d
/etc/cups
/etc/cups/subscriptions.conf.O
/etc/cups/subscriptions.conf
/etc/grub.d
/etc/issue
/etc/dbus-1/system.d
我記得他問我要不要改變按Y或是N的時候
有看到/etc/issue
但是我看了issue裏面沒有相關的東西
其他的幾個目錄底下我也還沒看到有會影響到ssh登入的script
※ 編輯: fedora 來自: 111.243.1.204 (02/13 00:59)
→
02/13 07:12, , 10F
02/13 07:12, 10F
→
02/13 07:22, , 11F
02/13 07:22, 11F
→
02/13 07:23, , 12F
02/13 07:23, 12F
→
02/13 07:24, , 13F
02/13 07:24, 13F
→
02/13 07:26, , 14F
02/13 07:26, 14F
→
02/13 07:26, , 15F
02/13 07:26, 15F