Skip to content

[BUG] salt-ssh fails with error command-line line 0: Missing argument #61650

@0x416e746f6e

Description

@0x416e746f6e

Description

If ssh config file is formatted like this:

Host test
    HostName       xxx.yyy.zzz.nnn
    IdentitiesOnly yes
    IdentityFile   ~/.ssh/test_id.pub  # <-- Note more than one space here

Then running command like salt-ssh -l trace --roster sshconfig 'test' -r 'hostname' fails with:

[DEBUG   ] Child Forked! PID: 98510  STDOUT_FD: 20  STDERR_FD: 22
[DEBUG   ] Terminal Command: ssh test -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no -o GSSAPIAuthentication=no -o ConnectTimeout=65 -o Port=22 -o IdentityFile= ~/.ssh/test_id.pub -o User=root hostname
[TRACE   ] command-line line 0: Missing argument.

^-- note space after -o IdentityFile=.

Setup

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior

  • Add extra space(s) between IdentityFile and the path in your ssh config.
  • Try to run salt-ssh

Expected behavior

No errors.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3004
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.0
     docker-py: Not Installed
         gitdb: 4.0.5
     gitpython: 3.1.12
        Jinja2: 2.11.3
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: 1.1.4
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.19
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.7.12 (default, Feb 15 2022, 12:03:52)
  python-gnupg: 0.4.4
        PyYAML: 5.4.1
         PyZMQ: 18.0.1
         smmap: 3.0.2
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.1
 
System Versions:
          dist: darwin 21.2.0 
        locale: UTF-8
       machine: x86_64
       release: 21.2.0
        system: Darwin
       version: 12.1 x86_64

Metadata

Metadata

Labels

Bugbroken, incorrect, or confusing behaviorSalt-SSHseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions