Git Product home page Git Product logo

ssh-cookbook's Introduction

The main purpose of this cookbook is to make openssh more secure.

One of the first things to do on a production server is to:

  • disable root logins
  • disable password logins
  • disable challenge response authentication
  • disable dns lookups

All these are cookbook's defaults, fully configurable via attributes. Before changing any of those defauls, make sure that you fully understand the implication.

To further increase the security, you can define specific groups (via :allowed_groups) and users (via :allowed_users) which are allowed to login via SSH. Everyone outside those groups or users (or both) won't be able to login.

I personally prefer the groups approach as it's more flexible. These are the more common groups which you might want to define in your node[:ssh][:allowed_groups]:

  • vagrant (you're doing all your staging on local VMs, controlled by vagrant, right?)
  • ubuntu (if you're running on AWS, you definitely want this group added)
  • deploy (all apps get their own system user, and belong to the deploy group)
  • admin (system users with admin privileges. Pretty much everyone that is expected to be in charge of the infrastructure).

LWRP

ssh_authorized_keys

Ensures ~/.ssh & ~/.ssh/authorized_keys are setup correctly (mainly permissions). It also populates the authorized_keys file with specific keys:

ssh_authorized_keys "root" do
  home "/root"
  ssh_keys node[:ssh][:root_authorized_keys]
end

ssh_config

Handles sshd_config CRUD. This is how AllowGroups in /etc/ssh/sshd_config gets managed:

ssh_config "AllowGroups" do
  string "AllowGroups #{node[:ssh][:allowed_groups].join(' ')}"
  only_if { node[:ssh][:allowed_groups].any? }
end

ssh_key

Handles passphraseless key generation, makes remote hosts known (eg. github.com) and copies SSH keys between hosts. Can also create keys from pre-defined private and public ones.

ssh-cookbook's People

Contributors

danpalmer avatar gerhard avatar jeanmertz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.