Skip to content

Comments in authorized_keys are truncated in ssh_auth module #40078

@Whissi

Description

@Whissi

Description of Issue/Question

The ssh_auth state module truncates comments on first space.

Setup

$ cat /srv/salt/demo/truncated-comment.sls:

thatch:
  ssh_auth.present:
    - user: root
    - source: salt://ssh_keys/thatch.id_rsa.pub

$ cat /srv/salt/ssh_keys/thatch.id_rsa.pub:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAp1J43RvhempWiclhhKmtEUySbEgMFbFLwGnefy//dHkij+yKEf2i52OdPSQNw2PwZJJEuofZYCppmiDRZ1zsrzRC7ly8IFdElaz99YeYpYWXw4oj6dZQK4NYBuhVv4cdHyCE349nXWkVm836rKaDaBTEzBiP/aLegqp2QeO4UgC6J7SjNVm0wp3WkWoRDTvdrbD9W94mO6XjJoD3J27pQ2bsDt83dQzmh1MDTGuv5cUxwMPww8YMXJcv7c5HUW3F+/ZTjpom2DJZRDc4p5rpOipEhEA0G+qPmmka86AQtiNywYek4P8dvTukkjV47AZZIopnbp2tt9n3Le9TnXjiXw== Thomas Hatch

Expected result

cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAp1J43RvhempWiclhhKmtEUySbEgMFbFLwGnefy//dHkij+yKEf2i52OdPSQNw2PwZJJEuofZYCppmiDRZ1zsrzRC7ly8IFdElaz99YeYpYWXw4oj6dZQK4NYBuhVv4cdHyCE349nXWkVm836rKaDaBTEzBiP/aLegqp2QeO4UgC6J7SjNVm0wp3WkWoRDTvdrbD9W94mO6XjJoD3J27pQ2bsDt83dQzmh1MDTGuv5cUxwMPww8YMXJcv7c5HUW3F+/ZTjpom2DJZRDc4p5rpOipEhEA0G+qPmmka86AQtiNywYek4P8dvTukkjV47AZZIopnbp2tt9n3Le9TnXjiXw== Thomas Hatch

Actual result

cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAp1J43RvhempWiclhhKmtEUySbEgMFbFLwGnefy//dHkij+yKEf2i52OdPSQNw2PwZJJEuofZYCppmiDRZ1zsrzRC7ly8IFdElaz99YeYpYWXw4oj6dZQK4NYBuhVv4cdHyCE349nXWkVm836rKaDaBTEzBiP/aLegqp2QeO4UgC6J7SjNVm0wp3WkWoRDTvdrbD9W94mO6XjJoD3J27pQ2bsDt83dQzmh1MDTGuv5cUxwMPww8YMXJcv7c5HUW3F+/ZTjpom2DJZRDc4p5rpOipEhEA0G+qPmmka86AQtiNywYek4P8dvTukkjV47AZZIopnbp2tt9n3Le9TnXjiXw== Thomas

(" Hatch" is missing).

Versions Report

Salt Version:
           Salt: 2016.11.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.13 (default, Jan 19 2017, 14:48:08)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.0
        machine: x86_64
        release: 4.9.0-2-amd64
         system: Linux
        version: debian 9.0

Metadata

Metadata

Assignees

Labels

ConfirmedSalt engineer has confirmed bug/feature - often including a MCVEPlatformRelates to OS, containers, platform-based utilities like FS, system based appsbugbroken, incorrect, or confusing behaviorseverity-low4th level, cosemtic problems, work around exists

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions