이후에 시작network-online.target

이후에 시작network-online.target

저는 아치 리눅스를 사용하고 있습니다. 재부팅 후 네트워크가 아직 작동되지 않아 sshd.service를 시작할 수 없습니다. 수동으로 실행해야 합니다.

sudo systemctl restart sshd

이 작업을 수행하면 sshd 서비스가 오류 없이 시작되어 정상적으로 실행되었습니다. systemd sshd.service가 자동으로 시작되도록 이 문제를 해결하려면 어떻게 해야 합니까?

로그는 다음과 같습니다.

May 06 15:47:23 server2 nm-dispatcher[471]: req:3 'connectivity-change': completed: no scripts
May 06 15:47:23 server2 nm-dispatcher[471]: req:3 'connectivity-change': new request (0 scripts)
May 06 15:47:23 server2 NetworkManager[440]: <info>  [1525636043.9284] manager: NetworkManager state is now CONNECTED_GLOBAL

May 06 15:47:22 server2 nm-dispatcher[471]: req:2 'up' [eth0]: completed: no scripts
May 06 15:47:22 server2 nm-dispatcher[471]: req:2 'up' [eth0]: new request (0 scripts)
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6632] manager: startup complete
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6626] device (eth0): Activation: successful, device activated.
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6566] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6565] manager: NetworkManager state is now CONNECTED_SITE
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6558] manager: NetworkManager state is now CONNECTED_LOCAL
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6557] device (eth0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'manag>
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6555] device (eth0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'manage>
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6549] device (eth0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6541] dhcp4 (eth0): state changed unknown -> bound
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6536] dhcp4 (eth0):   gateway 10.10.0.1
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6536] dhcp4 (eth0):   hostname 'server2'
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6536] dhcp4 (eth0):   domain name 'oaks'
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6536] dhcp4 (eth0):   nameserver '10.10.0.1'
May 06 15:47:22 server2 dbus-daemon[439]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.serv>
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6535] dhcp4 (eth0):   expires in 648000 seconds
May 06 15:47:22 server2 dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested >
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6535] dhcp4 (eth0):   plen 24
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6535] dhcp4 (eth0):   address 10.10.1.12
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6293] dhcp4 (eth0): activation: beginning transaction (timeout in 45 seconds)
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6284] device (eth0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6275] device (eth0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6262] manager: NetworkManager state is now CONNECTING
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6258] device (eth0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'manage>
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6251] device (eth0): Activation: starting connection 'Wired connection 1' (5b9f0bf9-ed10-31e5-bcad->
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6224] policy: auto-activating connection 'Wired connection 1'
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6206] device (eth0): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface>
May 06 15:47:22 server2 NetworkManager[440]: <info>  [1525636042.6196] device (eth0): carrier: link connected
May 06 15:47:22 server2 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
May 06 15:47:22 server2 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
May 06 15:47:22 server2 udisksd[598]: udisks daemon version 2.7.6 starting
May 06 15:47:22 server2 systemd[1]: Starting Disk Manager...

May 06 15:47:20 server2 systemd[1]: sshd.service: Failed with result 'exit-code'.
May 06 15:47:20 server2 systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
May 06 15:47:20 server2 sshd[564]: fatal: Cannot bind any address.
May 06 15:47:20 server2 sshd[564]: error: Bind to port 22 on 10.10.1.12 failed: Cannot assign requested address.
May 06 15:47:20 server2 systemd[1]: Started OpenSSH Daemon.
May 06 15:47:20 server2 systemd[1]: Stopped OpenSSH Daemon.
May 06 15:47:20 server2 systemd[1]: sshd.service: Scheduled restart job, restart counter is at 3.
May 06 15:47:20 server2 systemd[1]: sshd.service: Service hold-off time over, scheduling restart.
May 06 15:47:19 server2 systemd[1]: Startup finished in 12.430s (firmware) + 6.006s (loader) + 8.847s (kernel) + 2.106s (userspace) = 29.391s.
May 06 15:47:19 server2 polkitd[543]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
May 06 15:47:19 server2 systemd[1]: Started Authorization Manager.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
May 06 15:47:19 server2 polkitd[543]: Finished loading, compiling and executing 2 rules
May 06 15:47:19 server2 polkitd[543]: Error compiling script /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
May 06 15:47:19 server2 polkitd[543]: Loading rules from directory /usr/share/polkit-1/rules.d
May 06 15:47:19 server2 polkitd[543]: Loading rules from directory /etc/polkit-1/rules.d
May 06 15:47:19 server2 polkitd[543]: Started polkitd version 0.114
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.9110] supplicant: wpa_supplicant running
May 06 15:47:19 server2 wpa_supplicant[546]: Successfully initialized wpa_supplicant
May 06 15:47:19 server2 systemd[1]: Started WPA supplicant.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'
May 06 15:47:19 server2 systemd[1]: Started CUPS Scheduler.
May 06 15:47:19 server2 colord[526]: failed to get session [pid 465]: No data available
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8565] device (wlan0): set-hw-addr: set MAC address to 02:6B:94:A4:D1:08 (scanning)
May 06 15:47:19 server2 kernel: IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8563] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'e>
May 06 15:47:19 server2 systemd[1]: sshd.service: Failed with result 'exit-code'.
May 06 15:47:19 server2 sshd[540]: fatal: Cannot bind any address.
May 06 15:47:19 server2 systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
May 06 15:47:19 server2 sshd[540]: error: Bind to port 22 on 10.10.1.12 failed: Cannot assign requested address.
May 06 15:47:19 server2 systemd[1]: Starting WPA supplicant...
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8527] manager: (wlan0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/3)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8521] device (wlan0): driver supports Access Point (AP) mode
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8519] wifi-nl80211: (wlan0): using nl80211 for WiFi device control
May 06 15:47:19 server2 dbus-daemon[439]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service' requested by ':1.1' (u>
May 06 15:47:19 server2 systemd[1]: Starting Authorization Manager...
May 06 15:47:19 server2 systemd[1]: Started OpenSSH Daemon.
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8493] manager: rfkill: WiFi now disabled by radio killswitch
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8492] rfkill1: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1d.1/0000:05:00.0/ie>
May 06 15:47:19 server2 systemd[1]: Stopped OpenSSH Daemon.
May 06 15:47:19 server2 systemd[1]: sshd.service: Scheduled restart job, restart counter is at 2.
May 06 15:47:19 server2 systemd[1]: sshd.service: Service hold-off time over, scheduling restart.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service' requested by ':1.1' (uid=>
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.8479] ovsdb: Could not connect: No such file or directory
May 06 15:47:19 server2 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

May 06 15:47:19 server2 systemd[1]: sshd.service: Failed with result 'exit-code'.
May 06 15:47:19 server2 systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
May 06 15:47:19 server2 sshd[525]: fatal: Cannot bind any address.
May 06 15:47:19 server2 sshd[525]: error: Bind to port 22 on 10.10.1.12 failed: Cannot assign requested address.
May 06 15:47:19 server2 systemd[1]: Starting Manage, Install and Generate Color Profiles...
May 06 15:47:19 server2 systemd[1]: Started OpenSSH Daemon.
May 06 15:47:19 server2 systemd[1]: Stopped OpenSSH Daemon.
May 06 15:47:19 server2 systemd[1]: sshd.service: Scheduled restart job, restart counter is at 1.
May 06 15:47:19 server2 systemd[1]: sshd.service: Service hold-off time over, scheduling restart.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.9' (ui>
May 06 15:47:19 server2 kernel: ath: Regpair used: 0x69
May 06 15:47:19 server2 kernel: ath: Country alpha2 being used: 00
May 06 15:47:19 server2 kernel: ath: EEPROM indicates we should expect a direct regpair map
May 06 15:47:19 server2 kernel: ath: EEPROM regdomain: 0x69
May 06 15:47:19 server2 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6322] device (eth0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'ex>
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6298] settings: (eth0): created default wired connection 'Wired connection 1'
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6283] keyfile: add connection in-memory (5b9f0bf9-ed10-31e5-bcad-42dadabdcdad,"Wired connection 1")
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6253] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6223] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6207] device (lo): carrier: link connected
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6185] Loaded device plugin: NMOvsFactory (/usr/lib/NetworkManager/libnm-device-plugin-ovs.so)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.6170] Loaded device plugin: NMTeamFactory (/usr/lib/NetworkManager/libnm-device-plugin-team.so)
May 06 15:47:19 server2 kernel: ath10k_pci 0000:05:00.0: htt-ver 3.47 wmi-op 4 htt-op 3 cal otp max-sta 32 raw 0 hwcrypto 1
May 06 15:47:19 server2 kernel: ath10k_pci 0000:05:00.0: Unknown eventid: 90118
May 06 15:47:19 server2 kernel: ath10k_pci 0000:05:00.0: Unknown eventid: 118809
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5679] Loaded device plugin: NMWifiFactory (/usr/lib/NetworkManager/libnm-device-plugin-wifi.so)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5647] Loaded device plugin: NMBluezManager (/usr/lib/NetworkManager/libnm-device-plugin-bluetooth.s>
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5550] Loaded device plugin: NMWwanFactory (/usr/lib/NetworkManager/libnm-device-plugin-wwan.so)

May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5299] Loaded device plugin: NMAtmManager (/usr/lib/NetworkManager/libnm-device-plugin-adsl.so)

May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMVxlanDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMVlanDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMVethDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMTunDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMPppDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5276] Loaded device plugin: NMMacvlanDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMMacsecDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMIPTunnelDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMInfinibandDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMEthernetDeviceFactory (internal)
May 06 15:47:19 server2 nm-dispatcher[471]: req:1 'hostname': completed: no scripts
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMDummyDeviceFactory (internal)
May 06 15:47:19 server2 nm-dispatcher[471]: req:1 'hostname': new request (0 scripts)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMBridgeDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] Loaded device plugin: NMBondDeviceFactory (internal)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5275] dhcp-init: Using DHCP client 'internal'
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5274] manager: Networking is enabled by state file
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5274] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5273] manager: rfkill: WiFi enabled by radio killswitch; disabled by state file

May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.5267] settings: loaded plugin iBFT: (c) 2014 Red Hat, Inc.  To report bugs please use the NetworkMa>

May 06 15:47:19 server2 ntpd[458]: Command line: /usr/bin/ntpd -g -u ntp:ntp
May 06 15:47:19 server2 ntpd[458]: ntpd [email protected] Wed Mar  7 18:48:03 UTC 2018 (1): Starting


May 06 15:47:19 server2 systemd[1]: Started Network Manager Script Dispatcher Service.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'

May 06 15:47:19 server2 systemd[1]: sshd.service: Failed with result 'exit-code'.
May 06 15:47:19 server2 systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
May 06 15:47:19 server2 sshd[463]: fatal: Cannot bind any address.
May 06 15:47:19 server2 sshd[463]: error: Bind to port 22 on 10.10.1.12 failed: Cannot assign requested address.
May 06 15:47:19 server2 systemd[1]: Started Simple Desktop Display Manager.
May 06 15:47:19 server2 autossh[462]: ssh child pid is 476
May 06 15:47:19 server2 systemd[1]: Started Permit User Sessions.
May 06 15:47:19 server2 autossh[462]: starting ssh (count 1)
May 06 15:47:19 server2 autossh[462]: port set to 0, monitoring disabled
May 06 15:47:19 server2 autossh[468]: ssh child pid is 475
May 06 15:47:19 server2 autossh[468]: starting ssh (count 1)
May 06 15:47:19 server2 autossh[461]: ssh child pid is 474
May 06 15:47:19 server2 autossh[459]: ssh child pid is 473
May 06 15:47:19 server2 autossh[461]: starting ssh (count 1)
May 06 15:47:19 server2 autossh[460]: ssh child pid is 472
May 06 15:47:19 server2 autossh[459]: starting ssh (count 1)
May 06 15:47:19 server2 autossh[460]: starting ssh (count 1)
May 06 15:47:19 server2 systemd[1]: Starting Network Manager Script Dispatcher Service...
May 06 15:47:19 server2 autossh[466]: ssh child pid is 470
May 06 15:47:19 server2 autossh[466]: starting ssh (count 1)
May 06 15:47:19 server2 autossh[468]: port set to 0, monitoring disabled
May 06 15:47:19 server2 autossh[461]: port set to 0, monitoring disabled
May 06 15:47:19 server2 autossh[459]: port set to 0, monitoring disabled
May 06 15:47:19 server2 autossh[460]: port set to 0, monitoring disabled
May 06 15:47:19 server2 autossh[466]: port set to 0, monitoring disabled
May 06 15:47:19 server2 systemd[1]: Starting Permit User Sessions...
May 06 15:47:19 server2 systemd[1]: Starting CUPS Scheduler...
May 06 15:47:19 server2 systemd[1]: Started OpenSSH Daemon.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.ser>
May 06 15:47:19 server2 systemd[1]: Starting Network Time Service...
May 06 15:47:19 server2 systemd[1]: Reached target Network.
May 06 15:47:19 server2 systemd[1]: Started Network Manager.
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.4679] manager[0x5631afba8080]: rfkill: WWAN hardware radio set enabled
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.4678] manager[0x5631afba8080]: rfkill: WiFi hardware radio set disabled
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.4674] dns-mgr[0x5631afbc3130]: init: dns=default, rc-manager=symlink
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.4672] hostname: hostname changed from (none) to "server2"
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.4672] hostname: hostname: using hostnamed
May 06 15:47:19 server2 systemd[1]: Started Hostname Service.
May 06 15:47:19 server2 dbus-daemon[439]: [system] Successfully activated service 'org.freedesktop.hostname1'
May 06 15:47:19 server2 kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input19
May 06 15:47:19 server2 kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input18
May 06 15:47:19 server2 kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input17
May 06 15:47:19 server2 kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input16
May 06 15:47:19 server2 systemd[1]: Starting Hostname Service...
May 06 15:47:19 server2 dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' re>
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.1725] manager[0x5631afba8080]: monitoring kernel firmware directory '/usr/lib/firmware'.
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.1684] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 20-connectivity.conf)
May 06 15:47:19 server2 NetworkManager[440]: <info>  [1525636039.1683] NetworkManager (version 1.10.6-3, Arch Linux) is starting... (for the first time)
May 06 15:47:19 server2 systemd-logind[441]: Watching system buttons on /dev/input/event4 (  USB Keyboard)
May 06 15:47:19 server2 systemd-logind[441]: Watching system buttons on /dev/input/event3 (  USB Keyboard)
May 06 15:47:19 server2 systemd-logind[441]: Watching system buttons on /dev/input/event0 (Sleep Button)
May 06 15:47:19 server2 systemd-logind[441]: Watching system buttons on /dev/input/event1 (Power Button)
May 06 15:47:19 server2 systemd-logind[441]: Watching system buttons on /dev/input/event2 (Power Button)
May 06 15:47:19 server2 systemd-logind[441]: New seat seat0.
May 06 15:47:19 server2 systemd[1]: Reached target Timers.
May 06 15:47:19 server2 systemd[1]: Started Daily man-db cache update.
May 06 15:47:19 server2 systemd[1]: Started Daily verification of password and group files.
May 06 15:47:19 server2 systemd[1]: Started Daily Cleanup of Snapper Snapshots.
May 06 15:47:19 server2 systemd[1]: Started Daily autocommit of changes in /etc directory.
May 06 15:47:19 server2 systemd[1]: Starting Login Service...
May 06 15:47:19 server2 systemd[1]: Starting Network Manager...
May 06 15:47:19 server2 systemd[1]: Started D-Bus System Message Bus.
May 06 15:47:19 server2 systemd[1]: Reached target Basic System.
May 06 15:47:19 server2 systemd[1]: Reached target Sockets.
May 06 15:47:19 server2 systemd[1]: Listening on CUPS Scheduler.
May 06 15:47:19 server2 systemd[1]: Listening on D-Bus System Message Bus Socket.
May 06 15:47:19 server2 systemd[1]: Started Daily Cleanup of Temporary Directories.
May 06 15:47:19 server2 systemd[1]: Started Timeline of Snapper Snapshots.
May 06 15:47:19 server2 systemd[1]: Reached target Paths.
May 06 15:47:19 server2 systemd[1]: Started CUPS Scheduler.
May 06 15:47:19 server2 systemd[1]: Started Daily rotation of log files.
May 06 15:47:19 server2 systemd[1]: Reached target System Initialization.
May 06 15:47:19 server2 systemd[1]: Started Update UTMP about System Boot/Shutdown.
May 06 15:47:19 server2 systemd[1]: Starting Update UTMP about System Boot/Shutdown...
May 06 15:47:19 server2 systemd[1]: Started Create Volatile Files and Directories.
May 06 15:47:19 server2 systemd[1]: Starting Create Volatile Files and Directories...
May 06 15:47:19 server2 systemd[1]: Started Flush Journal to Persistent Storage.
May 06 15:47:18 server2 systemd[1]: Reached target Sound Card.

/usr/lib/systemd/system/sshd.service:

[Unit]
Description=OpenSSH Daemon
Wants=sshdgenkeys.service
After=sshdgenkeys.service
After=network.target

[Service]
ExecStart=/usr/bin/sshd -D
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target

# This service file runs an SSH daemon that forks for each incoming connection.
# If you prefer to spawn on-demand daemons, use sshd.socket and [email protected].

/etc/NetworkManager/NetworkManager.conf는 비어 있고 /etc/NetworkManager/conf.d/는 비어 있습니다.

주목할만한 로그 항목:

  • 5월 6일 15:47:22 server2 커널: e1000e: eth0 NIC 링크가 시작됨 1000Mbps 전이중, 흐름 제어: Rx/Tx
  • 5월 6일 15:47:19 server2 systemd[1]: sshd.service: '종료 코드'로 인해 실패했습니다.
  • 5월 6일 15:47:19 server2 systemd[1]: 대상 네트워크에 도달했습니다.

실제 인터페이스가 나타나기 전에 시스템이 대상 네트워크에 도달한 것으로 보입니다. 이 문제는 어떻게 해결됩니까?

답변1

AB에서 볼 수 있듯이 특정 IP 주소를 수신하도록 SSH 구성을 조정할 수 있습니다. sshd가 시작될 때 IP 주소를 사용할 수 없으면 서비스가 실패합니다.
기본적으로 sshd는 모든 주소를 의미하는 list on으로 구성되므로 0.0.0.0사용 가능한 특정 IP에 종속되지 않습니다.

이 문제를 해결하는 방법에는 두 가지가 있습니다.

이후에 시작network-online.target

systemd는 network-online.target네트워크가 완전히 시작되어야 하는(모든 인터페이스가 구성됨) 서비스를 위한 단위를 제공합니다. 이러한 방식으로 인터페이스를 구성한 후 로컬 시스템이 시작된 후 sshd가 시작되도록 할 수 있습니다.

mkdir /etc/systemd/system/sshd.service.d

cat > /etc/systemd/system/sshd.service.d/network-online.conf <<EOF
[Unit]
After=network-online.target
EOF

systemctl daemon-reload

로컬이 아닌 주소에 대한 바인딩 허용

또 다른 옵션은 호스트에 존재하지 않는 주소를 수신하도록 허용하는 것입니다.
솔루션은 시스템 전체에 적용되므로 SSHD뿐만 아니라 모든 서비스에서 작동합니다.

echo 'net.ipv4.ip_nonlocal_bind = 1' > /etc/sysctl.d/99-nonlocal_bind.conf

systemctl restart systemd-sysctl.service

답변2

@phemmer의 답변을 바탕으로 동일한 문제가 발생하여 추가하여 해결했습니다.

 [Unit]
 Wants=network-online.target
 After=network-online.target

/etc/systemd/system/sshd.service.d구성 파일 에서 .

또한 네트워크 관리자에 대해 올바른 대기 서비스가 활성화되어 있는지 확인하십시오.여기. 예를 들어:

 $ systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service

답변3

위의 어느 것도 나에게 적합하지 않습니다. cronjob을 사용하여 이 문제를 해결했습니다.

sudo crontab -e

그런 다음 다음을 추가합니다.

@reboot sleep 10; systemctl start sshd

답변4

NetworkManager를 사용하는 경우 다음을 시도해 보세요.

systemctl enable NetworkManager-wait-online.service

내가 아는 한, 여기에서는 보도가 답이 아닙니다. 핵심은 network.target및 의 정의 입니다 network-online.target. 이 시점에서는 네트워크가 연결될 것으로 기대하지만 이는 연결 프로세스가 완료되었음을 의미합니다. 즉, 아직 연결되어 있지만 아직 인터넷 연결이 작동하지 않을 수 있습니다.

내가 찾은 유일한 작동 솔루션은 dhcpcd.serviceNetworkManger에서 전환하는 것입니다. 처음에는 동일한 문제가 있었지만 이제는 활성화할 수 있습니다 NetworkManager-wait-online.service. network.target인터넷 연결이 가능할 때까지 기다리면 문제가 해결됩니다.

하지만 이 서비스가 기본적으로 활성화되지 않은 이유가 있습니다. 부작용으로는 다음과 같은 경우가 있습니다.시작 속도를 늦추세요네트워크 연결을 설정하는 데 시간이 오래 걸리는 경우. 내 사용 사례에서는 컴퓨터가 LAN 케이블을 통해 연결되어 있으며 시작 지연은 무시할 수 있습니다. 하지만 이 부작용에 주의하세요.

관련 정보