Skip to content

SSH service name based on distro, Ubuntu ssh upstart issue, repeated keyword on ssh_config#9

Closed
tcana1 wants to merge 4 commits intogchef:masterfrom
tcana1:master
Closed

SSH service name based on distro, Ubuntu ssh upstart issue, repeated keyword on ssh_config#9
tcana1 wants to merge 4 commits intogchef:masterfrom
tcana1:master

Conversation

@tcana1
Copy link

@tcana1 tcana1 commented May 8, 2014

This fixes 4 separate issues:

  1. Cookbook name: Added to metadata.rb for compatibility
  2. SSH service name: support changing service name based on distro (issue Support changing the ssh service name #4)
  3. COOK-3910: Uses Chef::Provider::Service::Upstart provider when restarting the service on Ubuntu 13 and up
  4. Duplicated keywords: If sshd_config has duplicated keywords (say with #commented out) the sed command will replace both, often causing ssh to break.

This is an example I ran into for item 4:

Original sshd_config file

#UseDNS yes
UseDNS no

Modified after Ched run

UseDNS no
UseDNS no

tcana1 added 4 commits May 8, 2014 18:40
…fig.

Some cloud images (i.e vagrant chef/centos-6.5) have sshd_config files
that list a keyword more than once, with and without a comment. The
old 'sed -i' statement would replace all occurrences of said keyword,
often breaking ssh.

This change removes all instances of the keyword and adds a new one at
the end of the file.
@tcana1
Copy link
Author

tcana1 commented May 8, 2014

This has been tested on Ubuntu12.04 LTS (hashicorp/precise32) and 14.04 LTS (ubuntu/trusty64), CentOS 6.5 (chef/centos-6.5) and Fedora 20 (chef/fedora-20)

@eddywashere
Copy link

+1

@tcana1 tcana1 closed this by deleting the head repository Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants