Re: ssh_config(5) man page improvement for RemoteCommand

2021-01-05 Thread Grégoire Jadi
Jason McIntyre  writes:

> On Tue, Jan 05, 2021 at 08:11:51PM +0100, Gr??goire Jadi wrote:
>
>> Hi,
>> 
>> When both RemoteCommand and ssh command are provided, the connection
>> fails with:
>> 
>> Cannot execute command-line and remote command.
>> 
>> Though the message is clear, I was puzzled because I couldn't find any
>> information in the man pages.  This patch adds a note in ssh_config(5).
>> 
>
> hi.
>
> this feels a bit like overkill: as you've said, the error message is
> clear. isn;t that hint enough? it doesn;t seem logical to expect that
> both would work.
>
> on the other hand, i suppose in theory the command in the config
> file could be ignored and the command-line command run, so maybe
> it does have to be said.

Actually, that's what happen with the User option.

Given ssh_config:

Host domain.tld
  User foo

Then ssh b...@domain.tld will ignore the User foo option.


Re-reading the man page of ssh_config(5) it says the following at the
very beginning:

 ssh(1) obtains configuration data from the following sources in the
 following order:

   1.   command-line options
   2.   user's configuration file (~/.ssh/config)
   3.   system-wide configuration file (/etc/ssh/ssh_config)

 For each parameter, the first obtained value will be used.

So, I think that ignoring the RemoteCommand (like the User option) is
more coherent.

> still i think what's there is enough.

Yes, I agree.

Thanks for the feedbacks.

> jmc
>
>> diff --git usr.bin/ssh/ssh_config.5 usr.bin/ssh/ssh_config.5
>> index 1007847662c..fa12092645e 100644
>> --- usr.bin/ssh/ssh_config.5
>> +++ usr.bin/ssh/ssh_config.5
>> @@ -1465,6 +1465,12 @@ Arguments to
>>  accept the tokens described in the
>>  .Sx TOKENS
>>  section.
>> +.Pp
>> +.Cm RemoteCommand
>> +is incompatible with
>> +.Xr ssh 1
>> +.Ar command
>> +argument given on the command line.
>>  .It Cm RemoteForward
>>  Specifies that a TCP port on the remote machine be forwarded over
>>  the secure channel.
>> 
>> Best,
>> 
>> -- 
>> gjadi
>> PGP : AF26 E9C2 A1C8 8D32 A868  4386 1373 5477 2B65 1894
>> 

-- 
gjadi
PGP : AF26 E9C2 A1C8 8D32 A868  4386 1373 5477 2B65 1894



Re: ssh_config(5) man page improvement for RemoteCommand

2021-01-05 Thread Jason McIntyre
On Tue, Jan 05, 2021 at 08:11:51PM +0100, Gr??goire Jadi wrote:
> Hi,
> 
> When both RemoteCommand and ssh command are provided, the connection
> fails with:
> 
> Cannot execute command-line and remote command.
> 
> Though the message is clear, I was puzzled because I couldn't find any
> information in the man pages.  This patch adds a note in ssh_config(5).
> 

hi.

this feels a bit like overkill: as you've said, the error message is
clear. isn;t that hint enough? it doesn;t seem logical to expect that
both would work.

on the other hand, i suppose in theory the command in the config
file could be ignored and the command-line command run, so maybe
it does have to be said.

still i think what's there is enough.

jmc

> diff --git usr.bin/ssh/ssh_config.5 usr.bin/ssh/ssh_config.5
> index 1007847662c..fa12092645e 100644
> --- usr.bin/ssh/ssh_config.5
> +++ usr.bin/ssh/ssh_config.5
> @@ -1465,6 +1465,12 @@ Arguments to
>  accept the tokens described in the
>  .Sx TOKENS
>  section.
> +.Pp
> +.Cm RemoteCommand
> +is incompatible with
> +.Xr ssh 1
> +.Ar command
> +argument given on the command line.
>  .It Cm RemoteForward
>  Specifies that a TCP port on the remote machine be forwarded over
>  the secure channel.
> 
> Best,
> 
> -- 
> gjadi
> PGP : AF26 E9C2 A1C8 8D32 A868  4386 1373 5477 2B65 1894
> 



ssh_config(5) man page improvement for RemoteCommand

2021-01-05 Thread Grégoire Jadi
Hi,

When both RemoteCommand and ssh command are provided, the connection
fails with:

Cannot execute command-line and remote command.

Though the message is clear, I was puzzled because I couldn't find any
information in the man pages.  This patch adds a note in ssh_config(5).

diff --git usr.bin/ssh/ssh_config.5 usr.bin/ssh/ssh_config.5
index 1007847662c..fa12092645e 100644
--- usr.bin/ssh/ssh_config.5
+++ usr.bin/ssh/ssh_config.5
@@ -1465,6 +1465,12 @@ Arguments to
 accept the tokens described in the
 .Sx TOKENS
 section.
+.Pp
+.Cm RemoteCommand
+is incompatible with
+.Xr ssh 1
+.Ar command
+argument given on the command line.
 .It Cm RemoteForward
 Specifies that a TCP port on the remote machine be forwarded over
 the secure channel.

Best,

-- 
gjadi
PGP : AF26 E9C2 A1C8 8D32 A868  4386 1373 5477 2B65 1894