All of lore.kernel.org
 help / color / mirror / Atom feed
* openssh_8.0p1 on zeus - sshd.service not starting #yocto
@ 2020-07-16 14:01 srijan.nandi
  2020-07-16 15:00 ` [yocto] " Zoran
  0 siblings, 1 reply; 9+ messages in thread
From: srijan.nandi @ 2020-07-16 14:01 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

I am facing an issue with openssh_8.0p1 on zeus...systemd is not able to start sshd.service. I am using the following sshd.service file.

[Unit]
Description=OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target sshdgenkeys.service
Wants=sshdgenkeys.service

[Service]
Type=forking
PIDFile=@localstatedir@/run/sshd.pid
EnvironmentFile=-@SYSCONFDIR@/default/sshd
ExecStart=@SBINDIR@/sshd -D $OPTIONS
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir -p /var/run/sshd
ExecStartPre=/bin/chmod -R 755 /var/run/sshd
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

Has anyone else faced a similar issue.

[-- Attachment #2: Type: text/html, Size: 1067 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] openssh_8.0p1 on zeus - sshd.service not starting #yocto
  2020-07-16 14:01 openssh_8.0p1 on zeus - sshd.service not starting #yocto srijan.nandi
@ 2020-07-16 15:00 ` Zoran
  2020-07-16 15:53   ` srijan.nandi
  0 siblings, 1 reply; 9+ messages in thread
From: Zoran @ 2020-07-16 15:00 UTC (permalink / raw)
  To: srijan.nandi; +Cc: yocto

On my BBB board (as test vehicle), the following is true:

root@arm:~# uname -a
Linux arm 5.7.6 #1 SMP Tue Jun 30 16:46:05 CEST 2020 armv7l GNU/Linux
root@arm:~# lshw -short
H/W path  Device  Class      Description
========================================
                  system     TI AM335x BeagleBone Black
/0                bus        Motherboard
/0/0              processor  cpu
/0/1              processor  idle-states
/0/2              memory     491MiB System memory
/1        eth0    network    Ethernet interface
root@arm:~# which systemctl
/bin/systemctl
root@arm:~# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: active (running) since Thu 2020-07-16 12:21:59 UTC; 2h 33min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 435 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 765 (sshd)
   Memory: 2.1M
   CGroup: /system.slice/ssh.service
           └─765 /usr/sbin/sshd -D

Jul 16 12:00:13 arm systemd[1]: Starting OpenBSD Secure Shell server...
Jul 16 12:21:59 arm sshd[765]: Server listening on 0.0.0.0 port 22.
Jul 16 12:21:59 arm sshd[765]: Server listening on :: port 22.
Jul 16 12:21:59 arm systemd[1]: Started OpenBSD Secure Shell server.
root@arm:~#

Although I am not running YOCTO there, you can see that I have systemd
present, and that my sshd server is running.

You should give us more info using: $ journalctl -u sshd.service -r -n 1

Zoran
_______

On Thu, Jul 16, 2020 at 4:01 PM <srijan.nandi@gmail.com> wrote:
>
> I am facing an issue with openssh_8.0p1 on zeus...systemd is not able to start sshd.service. I am using the following sshd.service file.
>
> [Unit]
> Description=OpenSSH server daemon
> Documentation=man:sshd(8) man:sshd_config(5)
> After=network.target sshdgenkeys.service
> Wants=sshdgenkeys.service
>
> [Service]
> Type=forking
> PIDFile=@localstatedir@/run/sshd.pid
> EnvironmentFile=-@SYSCONFDIR@/default/sshd
> ExecStart=@SBINDIR@/sshd -D $OPTIONS
> ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
> PermissionsStartOnly=true
> ExecStartPre=-/bin/mkdir -p /var/run/sshd
> ExecStartPre=/bin/chmod -R 755 /var/run/sshd
> KillMode=process
> Restart=on-failure
> RestartSec=42s
>
> [Install]
> WantedBy=multi-user.target
>
>
> Has anyone else faced a similar issue.
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: openssh_8.0p1 on zeus - sshd.service not starting #yocto
  2020-07-16 15:00 ` [yocto] " Zoran
@ 2020-07-16 15:53   ` srijan.nandi
  2020-07-16 16:47     ` [yocto] " Zoran
  0 siblings, 1 reply; 9+ messages in thread
From: srijan.nandi @ 2020-07-16 15:53 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

Hello Zoran,

I started the service and then ran journalctl -u sshd.service -r -n 10

This is what I see:

sshd.service Failed with result 'timeout'
sshd.service: start operation timed out. Terminating.

But if I run the /usr/sbin/sshd -f /etc/ssh/sshd_config, it starts fine.

Thanks,
-=Srijan Nandi

[-- Attachment #2: Type: text/html, Size: 456 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] openssh_8.0p1 on zeus - sshd.service not starting #yocto
  2020-07-16 15:53   ` srijan.nandi
@ 2020-07-16 16:47     ` Zoran
  2020-07-18 10:53       ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED} #yocto srijan.nandi
  0 siblings, 1 reply; 9+ messages in thread
From: Zoran @ 2020-07-16 16:47 UTC (permalink / raw)
  To: srijan.nandi; +Cc: yocto

From the source config file:
> ExecStart=@SBINDIR@/sshd -D $OPTIONS

From your reply:
> But if I run the /usr/sbin/sshd -f /etc/ssh/sshd_config, it starts fine.

If you run the command: /usr/sbin/sshd -D -f /etc/ssh/sshd_config, I
bet it'll fail again!

So, I have no idea what -D option does mean (lazy to investigate),
seems that this was the main cause of the problem:
https://unix.stackexchange.com/questions/390224/openssh-server-start-failed-with-result-timeout

Please, read this link carefully.

Best Regards,
Zoran
_______

On Thu, Jul 16, 2020 at 5:53 PM <srijan.nandi@gmail.com> wrote:
>
> Hello Zoran,
>
> I started the service and then ran journalctl -u sshd.service -r -n 10
>
> This is what I see:
>
> sshd.service Failed with result 'timeout'
> sshd.service: start operation timed out. Terminating.
>
> But if I run the /usr/sbin/sshd -f /etc/ssh/sshd_config, it starts fine.
>
> Thanks,
> -=Srijan Nandi 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED} #yocto
  2020-07-16 16:47     ` [yocto] " Zoran
@ 2020-07-18 10:53       ` srijan.nandi
  2020-07-18 13:52         ` [yocto] " Zoran
  0 siblings, 1 reply; 9+ messages in thread
From: srijan.nandi @ 2020-07-18 10:53 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

Finally was able to resolve the issue. It seems the sshd.service did not line Type=forking.

I changed it to Type=simple and it started working.

So now my sshd.service file looks like this:

[Unit]

Description=OpenSSH server daemon

Documentation=man:sshd(8) man:sshd_config(5)

After=network.target sshdkeygen.service

Wants=sshdkeygen.service

[Service]

Type=simple

PIDFile=/run/sshd.pid

EnvironmentFile=-@SYSCONFDIR@/default/sshd

ExecStart=@SBINDIR@/sshd -D $OPTIONS

ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID

PermissionsStartOnly=true

ExecStartPre=-/bin/mkdir -p /var/run/sshd

ExecStartPre=/bin/chmod -R 755 /var/run/sshd

KillMode=process

Restart=on-failure

RestartSec=42s

[Install]

WantedBy=multi-user.target

Thanks,
-=Srijan Nandi

[-- Attachment #2: Type: text/html, Size: 985 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED} #yocto
  2020-07-18 10:53       ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED} #yocto srijan.nandi
@ 2020-07-18 13:52         ` Zoran
  2020-07-18 15:19           ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto srijan.nandi
  0 siblings, 1 reply; 9+ messages in thread
From: Zoran @ 2020-07-18 13:52 UTC (permalink / raw)
  To: srijan.nandi; +Cc: yocto

> Finally was able to resolve the issue. It seems the sshd.service
> did not line Type=forking.
>
> I changed it to Type=simple and it started working.

Please, could you try with Type=notify ?

Thank you,
Zoran
_______

On Sat, Jul 18, 2020 at 12:53 PM <srijan.nandi@gmail.com> wrote:
>
> Finally was able to resolve the issue. It seems the sshd.service did not line Type=forking.
>
> I changed it to Type=simple and it started working.
>
> So now my sshd.service file looks like this:
>
>
>
> [Unit]
>
> Description=OpenSSH server daemon
>
> Documentation=man:sshd(8) man:sshd_config(5)
>
> After=network.target sshdkeygen.service
>
> Wants=sshdkeygen.service
>
>
>
> [Service]
>
> Type=simple
>
> PIDFile=/run/sshd.pid
>
> EnvironmentFile=-@SYSCONFDIR@/default/sshd
>
> ExecStart=@SBINDIR@/sshd -D $OPTIONS
>
> ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
>
> PermissionsStartOnly=true
>
> ExecStartPre=-/bin/mkdir -p /var/run/sshd
>
> ExecStartPre=/bin/chmod -R 755 /var/run/sshd
>
> KillMode=process
>
> Restart=on-failure
>
> RestartSec=42s
>
>
>
> [Install]
>
> WantedBy=multi-user.target
>
> Thanks,
> -=Srijan Nandi
>
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto
  2020-07-18 13:52         ` [yocto] " Zoran
@ 2020-07-18 15:19           ` srijan.nandi
  2020-07-18 15:37             ` [yocto] " Zoran
       [not found]             ` <1622E2E419693155.8854@lists.yoctoproject.org>
  0 siblings, 2 replies; 9+ messages in thread
From: srijan.nandi @ 2020-07-18 15:19 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Helo Zoran,

Type=notify didn't work, either.

The only thing that worked was Type=simple.

Thanks,
-=Srijan Nandi

[-- Attachment #2: Type: text/html, Size: 151 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto
  2020-07-18 15:19           ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto srijan.nandi
@ 2020-07-18 15:37             ` Zoran
       [not found]             ` <1622E2E419693155.8854@lists.yoctoproject.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Zoran @ 2020-07-18 15:37 UTC (permalink / raw)
  To: srijan.nandi; +Cc: yocto

This is what I have with my BBB on SDcard with Debian Buster:

root@arm:/etc/systemd/system# cat sshd.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

root@arm:/etc/systemd/system# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: active (running) since Fri 2020-07-17 17:22:23 UTC; 22h ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 650 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 691 (sshd)
    Tasks: 1 (limit: 1059)
   Memory: 2.2M
   CGroup: /system.slice/ssh.service
           └─691 /usr/sbin/sshd -D

Jul 17 17:22:22 arm systemd[1]: Starting OpenBSD Secure Shell server...
Jul 17 17:22:23 arm sshd[691]: Server listening on 0.0.0.0 port 22.
Jul 17 17:22:23 arm sshd[691]: Server listening on :: port 22.
Jul 17 17:22:23 arm systemd[1]: Started OpenBSD Secure Shell server.
root@arm:/etc/systemd/system#

Works seamlessly. Just for comparison.

Best Regards,
Zoran
_______

On Sat, Jul 18, 2020 at 5:19 PM <srijan.nandi@gmail.com> wrote:
>
> Helo Zoran,
>
> Type=notify didn't work, either.
>
> The only thing that worked was Type=simple.
>
> Thanks,
> -=Srijan Nandi 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto
       [not found]             ` <1622E2E419693155.8854@lists.yoctoproject.org>
@ 2020-07-18 15:42               ` Zoran
  0 siblings, 0 replies; 9+ messages in thread
From: Zoran @ 2020-07-18 15:42 UTC (permalink / raw)
  To: Zoran Stojsavljevic; +Cc: srijan.nandi, yocto

Although, I must admit, I have there OpenSSH_7.9p1.

Zoran
_______

On Sat, Jul 18, 2020 at 5:38 PM Zoran via lists.yoctoproject.org
<zoran.stojsavljevic=gmail.com@lists.yoctoproject.org> wrote:
>
> This is what I have with my BBB on SDcard with Debian Buster:
>
> root@arm:/etc/systemd/system# cat sshd.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
>
> root@arm:/etc/systemd/system# systemctl status sshd
> ● ssh.service - OpenBSD Secure Shell server
>    Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
>    Active: active (running) since Fri 2020-07-17 17:22:23 UTC; 22h ago
>      Docs: man:sshd(8)
>            man:sshd_config(5)
>   Process: 650 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
>  Main PID: 691 (sshd)
>     Tasks: 1 (limit: 1059)
>    Memory: 2.2M
>    CGroup: /system.slice/ssh.service
>            └─691 /usr/sbin/sshd -D
>
> Jul 17 17:22:22 arm systemd[1]: Starting OpenBSD Secure Shell server...
> Jul 17 17:22:23 arm sshd[691]: Server listening on 0.0.0.0 port 22.
> Jul 17 17:22:23 arm sshd[691]: Server listening on :: port 22.
> Jul 17 17:22:23 arm systemd[1]: Started OpenBSD Secure Shell server.
> root@arm:/etc/systemd/system#
>
> Works seamlessly. Just for comparison.
>
> Best Regards,
> Zoran
> _______
>
> On Sat, Jul 18, 2020 at 5:19 PM <srijan.nandi@gmail.com> wrote:
> >
> > Helo Zoran,
> >
> > Type=notify didn't work, either.
> >
> > The only thing that worked was Type=simple.
> >
> > Thanks,
> > -=Srijan Nandi
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-18 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 14:01 openssh_8.0p1 on zeus - sshd.service not starting #yocto srijan.nandi
2020-07-16 15:00 ` [yocto] " Zoran
2020-07-16 15:53   ` srijan.nandi
2020-07-16 16:47     ` [yocto] " Zoran
2020-07-18 10:53       ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED} #yocto srijan.nandi
2020-07-18 13:52         ` [yocto] " Zoran
2020-07-18 15:19           ` openssh_8.0p1 on zeus - sshd.service not starting [RESOLVED] #yocto srijan.nandi
2020-07-18 15:37             ` [yocto] " Zoran
     [not found]             ` <1622E2E419693155.8854@lists.yoctoproject.org>
2020-07-18 15:42               ` Zoran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.