Войти

Показать полную графическую версию : Не подключиться удаленно к freebsd через SSH


Страниц : [1] 2 3

blue_storm
03-07-2012, 17:54
Добрый день. У меня есть сервер с freebsd 8.0, который достался мне по наследству, не могу к нему подключиться удаленно. В файле rc.conf прописано sshd_enable = "YEs", пользователь отличный от root в группе wheel заведен, конфиг демона sshd подправлен
Port 22
Protocol 2
PasswordAuthentication yes
При подключении с помощью Putty выдается сообщение Network error: connection timeout
что делать? Freebsd занимаюсь вторую неделю, поэтому отвечайте, пожалуйста, максимально подробно. У меня еще есть на виртуальной машине freebsd для тренировок и изучения, вот к ней я могу подключаться удаленно. Подозреваю, что на реальной машине закрыт порт, как проверить закрыт или нет? Как узнать есть файерволл или нет?

leonty
03-07-2012, 21:57
содержимое rc.conf и sshd_config выкладывайте.

blue_storm
04-07-2012, 17:50
Вот содержимое.
http://s013.radikal.ru/i322/1207/a5/a460f4226472t.jpg (http://radikal.ru/F/s013.radikal.ru/i322/1207/a5/a460f4226472.jpg.html)
http://s018.radikal.ru/i511/1207/bc/6af1c38a8fd4t.jpg (http://radikal.ru/F/s018.radikal.ru/i511/1207/bc/6af1c38a8fd4.jpg.html)
http://s017.radikal.ru/i415/1207/30/4094b5cb20d6t.jpg (http://radikal.ru/F/s017.radikal.ru/i415/1207/30/4094b5cb20d6.jpg.html)
http://s019.radikal.ru/i611/1207/af/c30350aa4157t.jpg (http://radikal.ru/F/s019.radikal.ru/i611/1207/af/c30350aa4157.jpg.html)
http://s019.radikal.ru/i616/1207/19/362a656ea161t.jpg (http://radikal.ru/F/s019.radikal.ru/i616/1207/19/362a656ea161.jpg.html)
http://s53.radikal.ru/i140/1207/b0/227f03497ea3t.jpg (http://radikal.ru/F/s53.radikal.ru/i140/1207/b0/227f03497ea3.jpg.html)
http://s08.radikal.ru/i181/1207/2f/0164751549a5t.jpg (http://radikal.ru/F/s08.radikal.ru/i181/1207/2f/0164751549a5.jpg.html)
http://s54.radikal.ru/i146/1207/39/e4942a7bc783t.jpg (http://radikal.ru/F/s54.radikal.ru/i146/1207/39/e4942a7bc783.jpg.html)
http://s017.radikal.ru/i405/1207/fa/eefb4e310eddt.jpg (http://radikal.ru/F/s017.radikal.ru/i405/1207/fa/eefb4e310edd.jpg.html)
http://s019.radikal.ru/i638/1207/01/7319333a96e2t.jpg (http://radikal.ru/F/s019.radikal.ru/i638/1207/01/7319333a96e2.jpg.html)

leonty
04-07-2012, 18:20
ёшкин кот! а в текстовый файл нельзя было записаить и фрешкой перенести на место, откуда на форум пишите?

blue_storm
05-07-2012, 10:20
Ну понятно, что этот способ не по фэншую, но тем не менее по существу вопроса можно что-нибудь прокомментировать? Почему удаленно не подключиться? Спасибо.

vadblm
05-07-2012, 11:26
blue_storm, вы думаете, кто-то будет глаза ломать об картинки и вручную перепечатывать строки, где может быть загвоздка? Или вдруг проблема не там, вас попросят что-то ещё показать и вы снова будете устраивать фотосессию с монитором? Хотите помощи, так относитесь к потенциальным помощникам с уважением. Если не знаете как выковырять инфу в удобоваримом виде и лень гугл спросить, спросите нас, расскажем. К примеру, подключить флешку с fat/fat32 можно так:

mkdir -p /mnt/flash #создаём точку монтирования
# втыкаем флешку, в консоль должно вывалиться, какое имя устройство ей присвоено. Скажем, если в системе нет SCSI/SAS и подобных устройств, то присвоится имя da0.
mount -t msdosfs /dev/da0s1 /mnt/flash #монтируем
cp /etc/ssh/sshd_config /mnt/flash #копируем на флешку
umount /mnt/flash #размонтируем. Флешку можно извлекать

blue_storm
05-07-2012, 11:53
Спасибо большое.

blue_storm
06-07-2012, 10:01
вот файлы.

leonty
06-07-2012, 11:03
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
# $FreeBSD: src/crypto/openssh/sshd_config,v 1.49.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

# Note that some of FreeBSD's defaults differ from OpenBSD's, and
# FreeBSD has a few additional options.

#VersionAddendum FreeBSD-20090522

Port 22
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# 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 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# Change to yes to enable built-in password authentication.
PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable PAM authentication
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server



# -- sysinstall generated deltas -- # Fri Mar 26 13:35:07 2010
# Created: Fri Mar 26 13:35:07 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="212.232.69.37"
gateway_enable="YES"
hostname="gw"
ifconfig_re0="inet 212.232.69.38 netmask 255.255.255.252"
ifconfig_re1="inet 192.168.0.1 netmask 255.255.255.0"
ifconfig_re1_alias0="inet 192.168.0.54 netmask 255.255.255.0"
#
tcp_extensions="NO"
#
#static_routes="n8 n59"
#route_n8="-net 192.168.8.0/24 192.168.10.54"
#route_n59="-net 192.168.59.0/24 192.168.10.54"
svnserve_enable="YES"
svnserve_flags="-d --listen-port=3690"
svnserve_data="/home/svn/repositories"
svnserve_user="svn"
svnserve_group="svn"
sshd_enable="YES"


Подозреваю, что на реальной машине закрыт порт, как проверить закрыт или нет? »
telnet 192.168.0.1 22
Вывод не забудте закинуть сюда :)
Как узнать есть файерволл или нет? »
в вашем конкретном случае он не активен. Подробнее можно проситать здесь (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html). Еще есть волшебный файл /etc/defaults/rc.conf. Там можно посмотреть параметры, задаваемые в файле /etc/rc.conf.

и да, ps aux | grep sshd что выдает?

blue_storm
06-07-2012, 12:44
telnet 192.168.0.1 22
Вывод не забудте закинуть сюда »
Это нужно на фрибсд вводить или из винды можно?
Что еще нужно, кромеps aux | grep sshd что выдает? »?
Сейчас бойца зашлю, сервер на другом конце города находится, хотелось бы взять сразу все, что может понадобиться, чтобы сто раз не ездить.

VictorSh
06-07-2012, 17:10
Это нужно на фрибсд вводить или из винды можно? »
нужно с любого компа, который не сервер. В вашем случае из винды.

ps aux | grep sshd что выдает? » »
ps - аналог диспетчера задач в Windows, grep говорит, что выводить не все строчки, а только те, которые содержат подстроку sshd. То есть вас попросили проверить запущен ли демон ssh.

leonty
06-07-2012, 17:25
ps - аналог диспетчера задач в Windows »
если быть точнее, то это аналог утилиты tasklist, делает моментальный снимок процессов. аналог диспетчера задач windows - top, в реально времени отображает список процессов. :) но это мелочи

blue_storm
09-07-2012, 11:04
ps aux | grep sshd что выдает? »
root 3025 0,0 0,0 8060 1708 v0 S+ 10:51 0:00,00 grep sshd

Telepuzik
09-07-2012, 11:09
root 3025 0,0 0,0 8060 1708 v0 S+ 10:51 0:00,00 grep sshd »
Судя по этому у Вас демон sshd не запущен.

blue_storm
09-07-2012, 11:12
А почему? в конфиге написано sshd_enable = "YES"

Telepuzik
09-07-2012, 11:29
в конфиге написано sshd_enable = "YES" »
Серер давно перезагружали??
Вывод ls /etc/rc.d | grep sshd покажите.

blue_storm
09-07-2012, 11:37
Вывод ls /etc/rc.d | grep sshd покажите. »
просто пишет sshd
Сервер сегодня перезагружался.
На всякий случай выкладываю еще вывод команды sockstat |grep ssh
root sshd 9248 3 tcp4 *:22 *:*

Telepuzik
09-07-2012, 11:59
blue_storm,
Выполните /etc/rc.d/sshd start вывод покажите. Затем ps aux | grep sshd .

blue_storm
09-07-2012, 12:11
Выполните /etc/rc.d/sshd start вывод покажите. »

sshd already running? (pid=9248)
Затем ps aux | grep sshd . »
root 14072 0,0 0,0 8060 1708 v0 S+ 12:07 0:00,00 grep sshd

попутный вопрос, а как можно сохранить выводы команд, чтобы скопировать и прикреплять к сообщению, а не набирать руками?

Telepuzik
09-07-2012, 12:32
sshd already running? (pid=9248) »
Интересно. Покажите вывод netstat -an | grep 22.
а как можно сохранить выводы команд, чтобы скопировать и прикреплять к сообщению, а не набирать руками? »
Т.к. у Вас нет доступа по SSH то только перенаправлять вывод результов в файл, а потом файл копировать себе на машину и затем содержимое файлов выкладывать.




© OSzone.net 2001-2012