Bug 3136 - ssh RemoteForward show me "Missing target argument"
Summary: ssh RemoteForward show me "Missing target argument"
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 8.2p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-16 02:14 AEDT by pyygames
Modified: 2021-04-23 15:02 AEST (History)
1 user (show)

See Also:


Attachments
a sreenshot for my config and log (157.37 KB, image/png)
2020-03-16 02:14 AEDT, pyygames
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pyygames 2020-03-16 02:14:24 AEDT
Created attachment 3368 [details]
a sreenshot for my config and log

Env:
CentOS Linux release 7.4.1708 (Core)
OpenSSH_8.2p1, OpenSSL 1.0.2k-fips  26 Jan 2017

Issue reproduce:
step1. create a config file as bellow:
cat /etc/default/st2c2.config
Host centos2
   HostName centos2
   User user
   IdentityFile /home/user/.ssh/id_rsa
   RemoteForward 8888
   PubkeyAuthentication yes
   ServerAliveInterval 10
   ServerAliveCountMax 4
   ExitOnForwardFailure yes
   ConnectTimeout 10

step2. create a customize ssh tunnel as bellow:
cat /etc/systemd/system/st2c2.service

xxxxxx omit unit session xxxxxx
[Service]
ExecStart=/usr/bin/ssh -F /etc/default/st2c2.config -NT centos2
xxxx  omit install session xxxx

step3. systemctl start st2c2.service 

Step4. then it show me a lot of log as bellow:
Mar 15 22:43:45 centos1 systemd[1]: Started Setup a secure tunnel to Centos2.    Mar 15 22:43:45 centos1 systemd[1]: Starting Setup a secure tunnel to Centos2... Mar 15 22:43:45 centos1 ssh[4834]: /etc/default/st2c2.config line 5: Missing target argument.

Step5 if I connect host in bellow way, it works well
      ssh -F /etc/default/st2c2.config centos2 

Any advise ? under command prompt, it works ,but under service ,it always show my Missing target argument for my remote forward.
Comment 1 Darren Tucker 2020-03-16 17:39:14 AEDT
When you're testing from the command (In reply to pyygames from comment #0)
> CentOS Linux release 7.4.1708 (Core)
> OpenSSH_8.2p1, OpenSSL 1.0.2k-fips  26 Jan 2017

From what I can tell CenOS 7.4 has OpenSSH 7.4:
http://vault.centos.org/7.4.1708/updates/x86_64/drpms/

>    RemoteForward 8888

Reverse dynamic forwarding was added in 7.6:
https://www.openssh.com/txt/release-7.6

> xxxxxx omit unit session xxxxxx
> [Service]
> ExecStart=/usr/bin/ssh -F /etc/default/st2c2.config -NT centos2

The service is explicitly running the one in the system path.

> /etc/default/st2c2.config line 5: Missing target argument.

This is the error you'd get if you're using a version prior to when remote dynamic forwarding was added.

> Step5 if I connect host in bellow way, it works well
>       ssh -F /etc/default/st2c2.config centos2

Are you sure you're using the same ssh binary version?
Comment 2 pyygames 2020-03-16 18:28:21 AEDT
Hello,
Thanks , you are correct. They are different version binary.

[root@CentOS-vm ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
[root@CentOS-vm ~]# which ssh
/usr/bin/ssh

[root@CentOS-vm ~]# ssh -V
OpenSSH_8.2p1, OpenSSL 1.0.2k-fips  26 Jan 2017
[root@CentOS-vm ~]# which ssh
/usr/local/bin/ssh

Thank you again!
Comment 3 Darren Tucker 2020-03-16 18:31:34 AEDT
You're welcome.
Comment 4 Damien Miller 2021-04-23 15:02:01 AEST
closing resolved bugs as of 8.6p1 release