Git Product home page Git Product logo

centos-ssh's People

Contributors

jdeathe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

centos-ssh's Issues

Prevent SSHD startup errors appearing in docker logs

...
sshd stdout | Could not load host key: /etc/ssh/ssh_host_rsa_key
sshd stdout | Could not load host key: /etc/ssh/ssh_host_dsa_key
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
sshd_bootstrap stdout | Initialise SSH...

Issue occurs because Supervisord does not wait for completion of one process before starting another with a lower priority.

Will resolve issue raised here too: #3

Refactor validation helper functions

The helper functions implemented for configuration variable validation should be split out into functions that validate an input value and return true / false and getter functions to return a value with a default, safe, value.

Docker helper script functions should be using local variables

Docker helper functions have been created that use global scope variables instead of local scope variables.

Not causing any bugs currently but should be fixed as general maintenance/improvement.

Update README about configuration via environment variables.

Environment variables used to set the user settings will override the configuration volume in a new installation when using the new default values in the ssh-bootstrap.conf configuration file. This is achieved by assigning the variables in ssh-bootstrap.conf the value of the environment variable, (if set), or allowing an alternative value if not. In the following example the SSH_USER will be set to "custom-user" if the SSH_USER environment variable is not set or an empty string but if the user runs the container with an SSH_USER environment variable set it will override the value.

SSH_USER="${SSH_USER:-custom-user}"

Existing installations that use custom values in the ssh-bootstrap.conf saved on a configuration "data" volume will not allow override by the environment variables. Also users can hard code a value in the ssh-bootstrap.conf to prevent the value being replaced by that set using the environment variable.

setlocale warnings when execing to bash on a running container

Example Warnings shown from MacOSX host

docker exec -it ssh.pool-1.1.1 bash
bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory

Add option to import the Docker environment variables.

SSH, by default, sets up a new environment. It could be useful to have the environment variables set by Docker when using linked containers for example.

Would need to make sure not to change HOME and PATH.

SSHD has options for setting up user specific environment variables so might be better to use this method than adding the values into /etc/environment

Named volumes aren't getting created with the name defined.

I thought using volume_name:container_path syntax would keep the files in place within the container however this was incorrect; you still need to ensure the files are copied to the docker_host path.

Seems that using a volume without a host path is the most robust technique.

Environment variables when linking containers

This might be working as intended, or maybe not :)

As per the Docker docs:
These Environment variables are only set for the first process in the container. Similarly, some daemons (such as sshd) will scrub them when spawning shells for connection.

Am I, or am I not, supposed to be able to see environment variables when connecting with ssh? Are there any workarounds? Or is the intention that all containers expose additional ports and that they communicate via the Docker host over them?

Rationalise ssh-bootsrap

  • Remove commented out code.
  • Use heredoc syntax for multiline output instead of several echo commands.
  • get_option function should be using a local variable for value not a global scope variable.

Review docker commands used to create volume mappings

Target for Removal in Release: 1.11

When creating a container with a bind-mounted volume– docker run -v /host/path:/container/path – docker was automatically creating the /host/path if it didn’t already exist.

This auto-creation of the host path is deprecated and docker will error out if the path does not exist.

Add YUM version-lock and specify package versions in Dockerfile

To aid in making a tag reproducible the package versions being installed should be specified in the Dockerfile. Adding the version-lock package will make it easier for security updates to be applied without changing the version of packages installed as part of the Dockerfile.

Update the base packages

Latest versions of the base packages for CentOS 6.6 are:

  • vim-minimal-7.4.629-5.el6
  • sudo-1.8.6p3-20.el6_7
  • openssh-5.3p1-112.el6_7
  • openssh-server-5.3p1-112.el6_7
  • openssh-clients-5.3p1-112.el6_7
  • python-pip-7.1.0-1.el6
  • yum-plugin-versionlock-1.1.30-30.el6

Updated this to a BUG since full (uncached) builds now fail with the following yum error when specifying the existing packages:

No package sudo-1.8.6p3-15.el6 available.
No package openssh-5.3p1-104.el6_6.1 available.
No package openssh-server-5.3p1-104.el6_6.1 available.
No package openssh-clients-5.3p1-104.el6_6.1 available.
No package python-pip-1.3.1-4.el6 available.

Add better support for configuration via environment variables

Should be able to configure some basic settings via environment variables instead of having to use a configuration volume.

Allow the values of SSH_USER, SSH_PASSWORD and SSH_USER_HOME_DIR to be set and override any settings defined in the configuration volume.

Setting the root password in this way doesn't seem necessary at this point.

Add feature to set authorized_keys with environment variable.

The default SSH public key is currently set to the Vagrant insecure public key by default and requires the user to manually replace it after the container is running or use a configuration volume and replace the public key entries there. It should be possible to add a custom public key on running the container by setting an configuration environment variable.

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.