Hanging SSH In CentOS 7 And Systemd

Home » CentOS » Hanging SSH In CentOS 7 And Systemd
CentOS 3 Comments

Hi all,

I have a problem with my SSH sessions if I reboot with CentOS 7: my SSH
sessions seems terminated after the network is already shutdown.

How to fix that with Systemd?

Thank you in advance and best regards Oli

3 thoughts on - Hanging SSH In CentOS 7 And Systemd

  • Hi Harald,

    Through network.service

    Because I had trouble with the NetworkManager I’ve switched back to
    “normal” network management.

    Seems back again. I just wondering how such easy things can be so hard so solve.

    Best Regards Oli

  • Reindl Harald wrote:

    Don’t know what you mean.

    I’ve already found the ticket above before I’ve posted here. I tried to fix it with the change of
    /usr/lib/systemd/system/systemd-user-sessions.service or /usr/lib/systemd/system/sshd.service with dependencies to systemd-networkd.service and network.target but it changes nothing
    (obvious) in the behaviour.

    Best Regards Oli

  • Here the list of dependencies – seems to be that SSH is on the top level

    # systemctl list-dependencies

    default.target
    ├─auditd.service
    ├─avahi-daemon.service
    ├─brandbot.path
    ├─cobblerd.service
    ├─crond.service
    ├─dbus.service
    ├─dhcpd.service
    ├─httpd.service
    ├─iprdump.service
    ├─iprinit.service
    ├─iprupdate.service
    ├─irqbalance.service
    ├─kdump.service
    ├─named.service
    ├─network.service
    ├─plymouth-quit-wait.service
    ├─plymouth-quit.service
    ├─postfix.service
    ├─PostgreSQL.service
    ├─puppetdb.service
    ├─rsyslog.service
    ├─sshd.service
    ├─systemd-ask-password-wall.path
    ├─systemd-logind.service
    ├─systemd-readahead-collect.service
    ├─systemd-readahead-replay.service
    ├─systemd-update-utmp-runlevel.service
    ├─systemd-user-sessions.service
    ├─tuned.service
    ├─xinetd.service
    ├─basic.target
    │ ├─microcode.service
    │ ├─rhel-autorelabel-mark.service
    │ ├─rhel-autorelabel.service
    │ ├─rhel-configure.service
    │ ├─rhel-dmesg.service
    │ ├─rhel-loadmodules.service
    │ ├─paths.target
    │ ├─slices.target
    │ │ ├─-.slice
    │ │ └─system.slice
    │ ├─sockets.target
    │ │ ├─avahi-daemon.socket
    │ │ ├─dbus.socket
    │ │ ├─dm-event.socket
    │ │ ├─lvm2-lvmetad.socket
    │ │ ├─systemd-initctl.socket
    │ │ ├─systemd-journald.socket
    │ │ ├─systemd-shutdownd.socket
    │ │ ├─systemd-udevd-control.socket
    │ │ └─systemd-udevd-kernel.socket
    │ ├─sysinit.target
    │ │ ├─dev-hugepages.mount
    │ │ ├─dev-mqueue.mount
    │ │ ├─kmod-static-nodes.service
    │ │ ├─lvm2-monitor.service
    │ │ ├─plymouth-read-write.service
    │ │ ├─plymouth-start.service
    │ │ ├─proc-sys-fs-binfmt_misc.automount
    │ │ ├─sys-fs-fuse-connections.mount
    │ │ ├─sys-kernel-config.mount
    │ │ ├─sys-kernel-debug.mount
    │ │ ├─systemd-ask-password-console.path
    │ │ ├─systemd-binfmt.service
    │ │ ├─systemd-journal-flush.service
    │ │ ├─systemd-journald.service
    │ │ ├─systemd-modules-load.service
    │ │ ├─systemd-random-seed.service
    │ │ ├─systemd-sysctl.service
    │ │ ├─systemd-tmpfiles-setup-dev.service
    │ │ ├─systemd-tmpfiles-setup.service
    │ │ ├─systemd-udev-trigger.service
    │ │ ├─systemd-udevd.service
    │ │ ├─systemd-update-utmp.service
    │ │ ├─systemd-vconsole-setup.service
    │ │ ├─cryptsetup.target
    │ │ ├─local-fs.target
    │ │ │ ├─-.mount
    │ │ │ ├─boot.mount
    │ │ │ ├─rhel-import-state.service
    │ │ │ ├─rhel-readonly.service
    │ │ │ ├─srv.mount
    │ │ │ ├─systemd-fsck-root.service
    │ │ │ ├─systemd-remount-fs.service
    │ │ │ ├─tmp.mount
    │ │ │ ├─var-log.mount
    │ │ │ ├─var-tmp.mount
    │ │ │ └─var.mount
    │ │ └─swap.target
    │ │ ├─dev-disk-by\x2did-dm\x2dname\x2dvg01\x2dswap.swap
    │ │
    ├─dev-disk-by\x2did-dm\x2duuid\x2dLVM\x2dGSLnWL75i0tHFxe8FNZJB7PZtGI0yDzjNpAs3d4z3KSu0iMFjbjhY72AZZcvn0ke.swap
    │ │
    ├─dev-disk-by\x2duuid-2ceb4924\x2d2b67\x2d4c93\x2da750\x2d5765d1a6a0d1.swap
    │ │ ├─dev-dm\x2d0.swap │ │ ├─dev-mapper-vg01\x2dswap.swap │ │
    ├─dev-mapper-vg01\x2dswap.swap │ │ └─dev-vg01-swap.swap
    │ └─timers.target
    │ └─systemd-tmpfiles-clean.timer
    ├─getty.target
    │ └─getty@tty1.service
    └─remote-fs.target

LEAVE A COMMENT