Skip to content

server: add newline to the SSH key content - #3330

Closed
yadvr wants to merge 2 commits into
apache:masterfrom
shapeblue:kvm-host-ssh-systemvm
Closed

server: add newline to the SSH key content#3330
yadvr wants to merge 2 commits into
apache:masterfrom
shapeblue:kvm-host-ssh-systemvm

Conversation

@yadvr

@yadvr yadvr commented May 15, 2019

Copy link
Copy Markdown
Member

On first startup, the management server instantiates and saves random
ssh keys in the database by calling a trim() on the string data. On
latest CentOS7 release (CentOS Linux release 7.6.1810 (Core)) I could
reproduce the issue where router_proxy (ssh) failed and kept
prompting for passphrase. By adding a newline to the id_rsa.cloud private
key it did not prompt the same. This may likely be an environmental bug.

The patch fixes the issue by adding a newline at the end of the generated
SSH public/private keys in the DB.

SSH packages details:
libssh2.x86_64 1.4.3-12.el7_6.2 @updates
openssh.x86_64 7.4p1-16.el7 @anaconda
openssh-askpass.x86_64 7.4p1-16.el7 @base
openssh-clients.x86_64 7.4p1-16.el7 @anaconda
openssh-server.x86_64 7.4p1-16.el7 @anaconda

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

On first startup, the management server instantiates and saves random
ssh keys in the database by calling a `trim()` on the string data. On
latest CentOS7 release (CentOS Linux release 7.6.1810 (Core)) I could
reproduce the issue where router_proxy (ssh) did not fail and kept
prompting for passphrase. By adding a newline to the id_rsa.cloud private
key it did not prompt the same. This patch fixes the issue by adding a
newline at the end of the generated SSH public/private keys in the DB.

SSH packages details:
libssh2.x86_64                             1.4.3-12.el7_6.2            @updates
openssh.x86_64                             7.4p1-16.el7                @anaconda
openssh-askpass.x86_64                     7.4p1-16.el7                @base
openssh-clients.x86_64                     7.4p1-16.el7                @anaconda
openssh-server.x86_64                      7.4p1-16.el7                @anaconda

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr

yadvr commented May 15, 2019

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2737

@wido wido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on code

@yadvr

yadvr commented May 16, 2019

Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr

yadvr commented May 16, 2019

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2738

}
// try to patch and SSH into the systemvm for up to 5 minutes
for (int count = 0; count < 10; count++) {
for (int count = 0; count < 30; count++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the comment above be updated to read "up to 15 minutes"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhtyd is this change part of this commit ?

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3555)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 25308 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3330-t3555-kvm-centos7.zip
Smoke tests completed. 70 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr

yadvr commented May 16, 2019

Copy link
Copy Markdown
Member Author

I'll re-test using a fresh centos7 based env. I hit the problem again today, this time with virtual routers but not ssvm/cpvm with this PR. It's probably something to do openssh-client changes or possibly my env.

@yadvr

yadvr commented May 17, 2019

Copy link
Copy Markdown
Member Author

I've developed a better fix, will send a new PR.

@yadvr yadvr closed this May 17, 2019
@yadvr

yadvr commented May 17, 2019

Copy link
Copy Markdown
Member Author

@ustcweizhou opened a new PR with more explanation here: #3333

I also included a fix to ensure that ssh works on VR in case patching takes more time than anticipated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants