Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login: T971 allow quoting in public-keys options #995

Merged
merged 1 commit into from Sep 4, 2021
Merged

Conversation

plett
Copy link
Contributor

@plett plett commented Sep 3, 2021

Change Summary

Fixes T971 to allow you to specify where a user is allowed to connect from when using an ssh key

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

login

Proposed changes

This uses the " method already used by dhcp_server.py and interfaces-openvpn.py to allow putting " in the options field in authorized_keys.

This is my first PR against VyOS, so please forgive any mistakes I'm making. Thanks to @c-po for guidance via Slack.

This change requires a change to the documentation (actually, options isn't mentioned at all in the login docs). I am happy to add that, but want to make sure this patch is acceptable before doing so.

How to test

vyos@vyos# set system login user paul authentication public-keys paul@thinkpad options from="10.0.0.0/24"
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# sudo cat /home/paul/.ssh/authorized_keys
### Automatically generated by system-login.py ###

from="10.0.0.0/24" ssh-rsa <removed public key> paul@thinkpad

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

This patch allows the use of `&quot;` in ssh public-key options which
unlocks the ability to set the `from` option in a way that sshd will
accept to limit what hosts a user can connect from.
@c-po c-po merged commit 0f6e1c9 into vyos:current Sep 4, 2021
@plett plett deleted the T971 branch September 5, 2021 19:27
@plett
Copy link
Contributor Author

plett commented Sep 6, 2021

PR for documenting this is at vyos/vyos-documentation#613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants