-3
*uname -a
Linux xxxxxx 4.18.0-kali1-amd64 #1 SMP Debian 4.18.6-1kali1 (2018-09-10) x86_64 GNU/Linux

*apt list openssh-server -a
Listing... Done
openssh-server/kali-rolling,now 1:7.8p1-1 amd64 [installed]
openssh-server/kali-current 1:6.7p1-5 amd64

openssh-server/kali-rolling 1:7.8p1-1 i386
openssh-server/kali-current 1:6.7p1-5 i386

*chkconfig -l ssh
ssh 0:off 1:off 2:on 3:on 4:on 5:on 6:off

*systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-10-16 13:02:30 WIB; 2min 0s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 5194 (sshd)
Tasks: 1 (limit: 4915)
Memory: 1.1M
CGroup: /system.slice/ssh.service
└─5194 /usr/sbin/sshd -D

*dpkg-reconfigure openssh-server
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:e4OcOhxIa+B7QxDCM11LfkDdE/iU2MwSPYK2dm7npkg root@SubNetSystem (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:ABo5yaVcpeCD2T6FHteARRbhQAVYKjMTAE+2PdCFWiM root@SubNetSystem (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:tYtFtuFbXwhXcG5WpxgP62MLTrEhb7T4nPW53ho8fnM root@SubNetSystem (ED25519)
rescue-ssh.target is a disabled or a static unit, not starting it.

*systemctl cat sshd.service

/lib/systemd/system/ssh.service
[Unit]
Description=OpenBSD Secure Shell server
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755

[Install]
WantedBy=multi-user.target
Alias=sshd.service

*sudo systemctl enable ssh.service
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh

Note : Please correct it if there is a mistake in running it, I really appreciate any suggestions and I am a little hesitant about the Setup Patch SSHD Config that I have, please guide the original SSHD default setup


Edit: As requested:

#systemctl cat rescue-ssh.target
# /lib/systemd/system/rescue-ssh.target
[Unit]
Description=Rescue with network and ssh
Documentation=man:systemd.special(7)
Requires=network-online.target ssh.service
After=network-online.target ssh.service
AllowIsolate=yes


# systemctl status rescue-ssh.target
● rescue-ssh.target - Rescue with network and ssh
   Loaded: loaded (/lib/systemd/system/rescue-ssh.target; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd.special(7)
-1

Ÿour regular sshd service seems to be running just fine.

Based on the name, rescue-ssh.target is probably a separate service that is supposed to activate only when two conditions are met:

1.) the system cannot boot normally and falls back into rescue mode, and

2.) you've intentionally enabled rescue mode SSH access.

So this is probably not an issue at all.

To check further, please add the output of systemctl cat rescue-ssh.target and systemctl status rescue-ssh.target into your question post.

  • 1
    That doesn't explain why the maintainer script for openssh-server is messing with it. – JdeBP Oct 16 '18 at 20:22
  • Maybe some dependencies between rescue-ssh.target and other things are causing the start attempt? To check for this, I would need the output of your systemctl cat rescue-ssh.target. Or maybe the maintainer script wants to verify that the rescue-ssh configuration is actually runnable, but only if it's been enabled, and the message is just a side effect of that check? Since you said your SSHD set-up is modified, I would need more details from your system to be able to say anything better than wild guesses. – telcoM Oct 17 '18 at 10:51
  • Details from my system would not do you any good at all. – JdeBP Oct 18 '18 at 6:06
  • JdeBP: oops, you weren't the original poster. My mistake. Rephrasing: ...need more details from the original poster's system... – telcoM Oct 18 '18 at 6:09
  • I looked through the postinst maintainer script, and there's nothing there that would directly affect anything named rescue-ssh, let alone a target named that. It's some indirect effect. – JdeBP Oct 18 '18 at 6:13

protected by Community Nov 21 '18 at 19:17

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.