Using SSH to execute commands on an other host I found:
The script
echo "-- server" ssh -l stream server ls -la /var/log/server/*.log echo "-- server-extern" ssh -l stream server-extern ls -la /var/log/server/*.log
Whatever problem with ssh/openssh there might be following you behind, there is another mistake in the commandline in the first place: quoting. ssh -l stream server ls -la /var/log/server/*.log with files (LOCAL!) in /var/log/server that are named 1.log and 2.log expands to ssh -l stream server ls -la /var/log/server/1.log /var/log/server/2.log or, in other words, you have to quote the "*" for it to be expanded on the remote side instead of the local side. If you don't have any files in /var/log/server/ that match the pattern, then bash thinks it must be smart and feeds the literal "*" into the string. This is not consistent with other shells...
if started manually in a shell (user stream, group stream). If started by cron this script will hang while running "ssh -l stream server ls ...". The command "ls" will execute, but ssh won't come back again. The connection is terminated after execution of the command.
OpenSSH on host: openssh-2.9p1-23, SuSE 7.2 OpenSSH on server: openssh-2.9p1-23, SuSE 7.2 OpenSSH on server-extern: openssh-2.3.0p1-5, SuSE 7.0
Any idea, why this happens? Did someone else notice this behavior?
Use "-v" to see what happens. Otherwise, there's little chance to find out what goes wrong...
-- Thomas
Roman. -- - - | Roman Drahtmüller <draht@suse.de> "Caution: Cape does not | SuSE GmbH - Security enable user to fly." | Nürnberg, Germany (Batman Costume warning label) | - -