rsync zu bestimmtem SSH Port

Wenn man Daten via rsync zu einem Zielrechner synchronisieren möchte, der nicht auf dem Standard-SSH-Port 22 lauscht, muss man das rsync Kommando etwas anpassen. Der Ausschnitt aus der man page von rsync, der verrät wie es geht: -e, --rsh=COMMAND This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with [user@]host::module/path, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section "USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION" above. Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double- quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples: -e 'ssh -p 2234' -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"' (Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.) You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e. See also the --blocking-io option which is affected by this option. Man kann also den Port wie folgt angeben: ...

Juli 29, 2014 · 2 Minuten

Per SSH den falschen Rechner rebooten

Wem das auch schon mal passiert ist: ~# reboot Broadcast message from root (pts/0) (Sat Jul 11 14:48:21 2009): The system is going down for reboot NOW! Und man sich anschließend denkt “Oops”, das war der falsche. Ja, dann, dann hat man molly-guard nicht installiert. Also ran da: ~# aptitude install molly-guard Will man nun nachdem man molly-guard installiert hat den Rechner wieder per Remote-Session rebooten, so sieht das ganze wie folgt aus: ~# reboot W: molly-guard: SSH session detected! Please type in hostname of the machine to reboot: kelly Good thing I asked; I won't reboot doug ... W: aborting reboot due to 30-query-hostname exiting with code 1. Das sieht doch schon mal gleich wieder viel besser aus. *glückgehabt*

Juli 11, 2009 · 1 Minute