ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Andrey Liakhovets" <liakh@dol.ru>
To: community@lists.altlinux.org
Subject: [Comm] работает ли sshd
Date: Mon, 08 Jul 2013 11:15:08 +0400
Message-ID: <web-1164385488@cgp.dol.ru> (raw)
In-Reply-To: <CABXL3AVa--O22rw6=-Eqs+RmdDHMZ2FWpPJM+FE=We83EA4EAQ@mail.gmail.com>

On Mon, 8 Jul 2013 13:01:32 +0700 Vyacheslav Brunev wrote:
>Что говорит:
>chkconfig --list sshd
>
>Если всё выкл. то:
>chkconfig sshd on

chkconfig задаёт запуск/останов сервисов при переходе системы между
runlevel'ами (man chkconfig), в частности, при загрузке системы.

Чтобы проверить и изменить состояние сервиса прямо сейчас, есть команда
service:
# service sshd status
 и если выключен, то:
# service sshd start

>8 июля 2013 г., 12:28 пользователь Andrew написал:
>
>>  Всем здравствуйте!
>> Взялся тут, значит, настраивать доступ по ssh на сервере. Просканировав
>> порт 22 утилитой nmap выяснилось:
>> *22/tcp closed ssh*.
>> Попробовал добавить правило в iptables:
>> *-A INPUT -i eth1 -p tcp -m tcp --dport 22 -j ACCEPT* (это строка в
>> выводе iptables-save).
>>
>> Но по-прежнему порт закрыт и при попытке подключения ssh-клиент выдаёт:
>> *ssh: connect to host 192.168.1.111 port 22: Connection refused*.
>>
>> Помогите, пожалуйста разобраться. Может я что-то упустил из виду?

iptables стоит крутить после, когда с сервисом sshd разобрались :)

Кстати, есть ещё такая команда control (man control),
а среди доступных ей "ручек" есть пара в sshd:
# control | grep sshd
И, особенно для сервера, имеет смысл сделать доступ только по ключу:
control sshd-password-auth disabled, затем перезапустить sshd,
т.к. control только изменяет конфиг sshd. Естественно, положив в нужное
место ключи.
(Если всё это делаете не с консоли, а по ssh, то перезапускайте так:
service sshd reload, тогда текущие ssh-соединения останутся живы, и вы
сможете проверить результат и при ошибке откатить.)

Андрей Ляховец


       reply	other threads:[~2013-07-08  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08  7:15   ` Andrey Liakhovets [this message]
2013-07-08  8:17     ` Andrew
2013-07-08  9:08       ` Andrey Liakhovets

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=web-1164385488@cgp.dol.ru \
    --to=liakh@dol.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git