Mailinglist Archive: opensuse-security (343 mails)

< Previous Next >
Re: [suse-security] Misterious non functions with OpenSSH
  • From: Roman Drahtmueller <draht@xxxxxxx>
  • Date: Wed, 18 Jul 2001 16:56:09 +0200 (MEST)
  • Message-id: <Pine.LNX.4.33.0107181651420.17039-100000@xxxxxxxxxxxx>
> 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 Drahtm├╝ller <draht@xxxxxxx> "Caution: Cape does not |
SuSE GmbH - Security enable user to fly."
| N├╝rnberg, Germany (Batman Costume warning label) |
- -

< Previous Next >