Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Unreasonable line break in ros config get ssh_authorized_keys #2579

Closed
kingsd041 opened this issue Nov 23, 2018 · 2 comments
Closed

Unreasonable line break in ros config get ssh_authorized_keys #2579

kingsd041 opened this issue Nov 23, 2018 · 2 comments

Comments

@kingsd041
Copy link
Contributor

RancherOS Version: (ros os version) version v1.4.2 from os image rancher/os:v1.4.2

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

When I run ros config get ssh_authorized_keys, the result of ssh_authorized_keys will be displayed in two lines.

[rancher@rancher ~]$ sudo ros config get ssh_authorized_keys
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2Sx8dhcxM16zUIJGUsoHvium2ezzXL5F5obBvWd441BSau1XTDVdO3zOchF3mWvYX5q4JT1CF4GntvM1vc16acuVmkzsjsDe3+4uVPPzJps01vDxVeV1vRM53P2deCUnrFJ48CvrPisyXSOCtUCRFC1pPdvVAnOyTkzboQkCEbt6551bXF2nTnZu7XOSdzAKj+YLIRNf/ecr4hJi9xW7Q4N6gP0C+zn/KjvFQ0QSN5t8Cpbg4ri7uR2Vd4a0ccyJ5TQLRJ3EtAvuVZK3CeY0B3/XlD31cLMSFgLpWDBU2p9OC27Lc3grcYL2kN1A1HsV5AjBWRfTnFuCcOQ7MNdjJ
  root@ip-172-31-27-41

View ~/.ssh/authorized_keys is the correct value

[rancher@rancher ~]$ cat ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2Sx8dhcxM16zUIJGUsoHvium2ezzXL5F5obBvWd441BSau1XTDVdO3zOchF3mWvYX5q4JT1CF4GntvM1vc16acuVmkzsjsDe3+4uVPPzJps01vDxVeV1vRM53P2deCUnrFJ48CvrPisyXSOCtUCRFC1pPdvVAnOyTkzboQkCEbt6551bXF2nTnZu7XOSdzAKj+YLIRNf/ecr4hJi9xW7Q4N6gP0C+zn/KjvFQ0QSN5t8Cpbg4ri7uR2Vd4a0ccyJ5TQLRJ3EtAvuVZK3CeY0B3/XlD31cLMSFgLpWDBU2p9OC27Lc3grcYL2kN1A1HsV5AjBWRfTnFuCcOQ7MNdjJ root@ip-172-31-27-41
@niusmallnan niusmallnan changed the title ros config get ssh_authorized_keys folding display Unreasonable line break in ros config get ssh_authorized_keys Nov 23, 2018
@Aisuko
Copy link

Aisuko commented Dec 7, 2018

In our project, we use the yaml.Marshal function to generates valid YAML, it's a third party library go-yaml.

Refer to the YAML spec section 8.1.3 from http://yaml.org/spec/1.2/spec.html, which says Folding allows long lines to be broken anywhere a single space character separates two non-space characters.

So the yaml.Marshal function splits long string(>80-character) values on to multiple lines, but 80 length is hard code now. The go-yaml v3 will update something about this, please check this PR (go-yaml/yaml#329).

@kingsd041
Copy link
Contributor Author

Fixed in RancherOS v1.5.1-rc1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants