Giter Club home page Giter Club logo

ansible-role-secure-openssh-server's People

Contributors

elnappo avatar poppen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

poppen drifterza

ansible-role-secure-openssh-server's Issues

ssh_permit_root_login: no fails

When setting:

  vars:
    - ssh_permit_root_login: no

The following error occurs:
failed: [XXX.XXX.XXX.XXX] => (item={u'regexp': u'^PermitRootLogin ', u'line': u'PermitRootLogin False'}) => {"failed": true, "item": {"line": "PermitRootLogin False", "regexp": "^PermitRootLogin "}, "msg": "failed to validate: rc:255 error:/tmp/tmpW9eey5 line 28: unsupported option \"False\".\r\n"}

It appears ansible's yaml syntax reads "no" as falsy and stores the value False. This can be worked around by using:

  vars:
    - ssh_permit_root_login: "no"

The simplest way forward might be to just document this in defaults/main.yml where the values for ssh_permit_root_login are already documented. I suspect the value "yes" (without quotes) will similarly be considered truthy and converted to True by ansible.

Might run SSH on several ports

Actually, if we change the ssh_port variable, it ends up adding a line containing port <ssh_port value> to the sshd_config file. Thus, the daemon is listening on several ports, and the related ufw rules are added.

IMHO, the expected behaviour would be to have the daemon listening on a single port. It is actually a bit misleading: reading the config, we can expect ssh to be accessible on a single port, which might not be the case based on the "history" of the changes...

User need access to the sshd executable

Main issue

Took me a while to understand that the validations where failing because sshd was not in my user's PATH.
Therefore, I think it might be useful to add a check to the pre.yml file to verify that.

For debian users

sshd being located in /usr/sbin, ansible user will need sudo capabilities.
Adding a become instruction solves the problem, example:

roles:
  - { role: elnappoo.secure-openssh-server,
      become: yes }

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.