From: mhoellein Date: Thu, 13 Dec 2018 12:50:31 +0000 (+0100) Subject: autossh vserver funktioniert X-Git-Url: https://git.hoellein.online/?a=commitdiff_plain;h=d47a567d0b35e3b47870c82ae32c8134da5af11b;p=homeserver autossh vserver funktioniert --- diff --git a/.etckeeper b/.etckeeper index b55eda9b..c2eccb78 100755 --- a/.etckeeper +++ b/.etckeeper @@ -2126,6 +2126,7 @@ maybe chmod 0644 'default/apache-htcacheclean' maybe chmod 0644 'default/apcupsd' maybe chmod 0644 'default/arpwatch' maybe chmod 0644 'default/asterisk' +maybe chmod 0644 'default/autossh' maybe chmod 0644 'default/avahi-daemon' maybe chmod 0644 'default/batmand' maybe chmod 0644 'default/bind9' diff --git a/cups/printers.conf b/cups/printers.conf index 638c4b2c..83707699 100644 --- a/cups/printers.conf +++ b/cups/printers.conf @@ -20,14 +20,14 @@ OpPolicy default ErrorPolicy retry-job -UUID urn:uuid:7b0aa7bf-b984-39e9-722c-6b689f5387e2 +UUID urn:uuid:fa3b232e-0bde-3b04-61fe-187a3d4d5413 Info Location MakeModel HP Color LaserJet MFP M277dw, driverless, cups-filters 1.20.2 DeviceURI ipps://NPI9D0E59.local:443/ipp/print State Idle -StateTime 1544608051 -ConfigTime 1544608051 +StateTime 1544702856 +ConfigTime 1544702856 Type 8425564 Accepting Yes Shared No diff --git a/cups/printers.conf.O b/cups/printers.conf.O index 3c0a99fa..978afab1 100644 --- a/cups/printers.conf.O +++ b/cups/printers.conf.O @@ -19,3 +19,23 @@ KLimit 0 OpPolicy default ErrorPolicy retry-job + +UUID urn:uuid:aa605245-41f4-3b6f-4bac-c70bafd338c5 +Info +Location +MakeModel HP Color LaserJet MFP M277dw, driverless, cups-filters 1.20.2 +DeviceURI ipps://NPI9D0E59.local:443/ipp/print +State Idle +StateTime 1544691923 +ConfigTime 1544691923 +Type 8425564 +Accepting Yes +Shared No +JobSheets none none +QuotaPeriod 0 +PageLimit 0 +KLimit 0 +OpPolicy default +ErrorPolicy retry-job +Option cups-browsed true + diff --git a/default/autossh b/default/autossh new file mode 100644 index 00000000..8e6dac7f --- /dev/null +++ b/default/autossh @@ -0,0 +1,5 @@ +AUTOSSH_POLL=60 +AUTOSSH_FIRST_POLL=30 +AUTOSSH_GATETIME=0 +AUTOSSH_PORT=22000 +SSH_OPTIONS="-N -R 12345:localhost:22 root@hoellein.online -i /var/lib/autossh/.ssh/root@hoellein.online" diff --git a/passwd b/passwd index d71abaac..9ce64301 100644 --- a/passwd +++ b/passwd @@ -75,4 +75,4 @@ Debian-snmp:x:145:121::/var/lib/snmp:/bin/false geoclue:x:148:155::/var/lib/geoclue:/usr/sbin/nologin lool:x:149:156::/opt/lool:/usr/sbin/nologin serverbackup:x:5003:5003::/home/serverbackup:/bin/bash -autossh:x:5004:5004:ssh tunnel user:/home/autossh:/bin/sh +autossh:x:5004:5004:ssh tunnel user:/var/lib/autossh:/bin/sh diff --git a/systemd/system/autossh.service b/systemd/system/autossh.service index 4eac245a..44c4d395 100644 --- a/systemd/system/autossh.service +++ b/systemd/system/autossh.service @@ -1,17 +1,24 @@ [Unit] -Description=Keeps a tunnel to 'remote.example.com' open +Description=Keeps a tunnel to 'hoellein.online' open (only IPv4) After=network.target ssh.service [Service] User=autossh +Type=simple +EnvironmentFile=/etc/default/autossh # -p [PORT] # -l [user] # -M 0 --> no monitoring # -N Just open the connection and do nothing (not interactive) # LOCALPORT:IP_ON_EXAMPLE_COM:PORT_ON_EXAMPLE_COM -ExecStart=/usr/bin/autossh -M 20000 -f -i /root/.ssh/root@hoellein.online -N -T -R12345:localhost:22 root@hoellein.online -ExecStop=/usr/bin/killall -s KILL autossh -RestartSec=5 +#ExecStart=/usr/bin/autossh -M 20000 -f -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -N -T -R12345:localhost:22 -4 -i /var/lib/autossh/.ssh/root@hoellein.online hoellein.online +ExecStart=/usr/bin/autossh $SSH_OPTIONS +Restart=always +#ExecStop=/usr/bin/killall -s KILL autossh +RestartSec=60 +#Environment=AUTOSSH_GATETIME=0 +#Environment=AUTOSSH_DEBUG=7 +#Environment=AUTOSSH_LOGFILE=/var/lib/autossh/autossh.log [Install] WantedBy=multi-user.target