</span></code></pre></div></p><p>Then simply follow the prompts. The keys generated by this script are only displayed on your console output, so make sure to save them somewhere after generation.</p><h2id=usage>Usage<aclass=headerlinkhref=#usagetitle="Permanent link">¶</a></h2><p>To help you get started creating a container from this image you can either use docker-compose or the docker cli.</p><h3id=docker-compose-recommended-click-here-for-more-info>docker-compose (recommended, <ahref=https://docs.linuxserver.io/general/docker-compose>click here for more info</a>)<aclass=headerlinkhref=#docker-compose-recommended-click-here-for-more-infotitle="Permanent link">¶</a></h3><divclass="language-yaml highlight"><pre><span></span><code><spanid=__span-1-1><aid=__codelineno-1-1name=__codelineno-1-1href=#__codelineno-1-1></a><spanclass=nn>---</span>
</span></code></pre></div><h3id=docker-cli-click-here-for-more-info>docker cli (<ahref=https://docs.docker.com/engine/reference/commandline/cli/>click here for more info</a>)<aclass=headerlinkhref=#docker-cli-click-here-for-more-infotitle="Permanent link">¶</a></h3><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-2-1><aid=__codelineno-2-1name=__codelineno-2-1href=#__codelineno-2-1></a>docker<spanclass=w></span>run<spanclass=w></span>-d<spanclass=w></span><spanclass=se>\</span>
</span></code></pre></div><h2id=parameters>Parameters<aclass=headerlinkhref=#parameterstitle="Permanent link">¶</a></h2><p>Docker images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <code><external>:<internal></code> respectively. For example, <code>-p 8080:80</code> would expose port <code>80</code> from inside the container to be accessible from the host's IP on port <code>8080</code> outside the container.</p><h3id=ports-p>Ports (<code>-p</code>)<aclass=headerlinkhref=#ports-ptitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Parameter</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>2222</code></td><td>ssh port</td></tr></tbody></table><h3id=environment-variables-e>Environment Variables (<code>-e</code>)<aclass=headerlinkhref=#environment-variables-etitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Env</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>PUID=1000</code></td><td>for UserID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>PGID=1000</code></td><td>for GroupID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>TZ=Etc/UTC</code></td><td>specify a timezone to use, see this <ahref=https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List>list</a>.</td></tr><tr><tdstyle="text-align: center;"><code>PUBLIC_KEY=yourpublickey</code></td><td>Optional ssh public key, which will automatically be added to authorized_keys.</td></tr><tr><tdstyle="text-align: center;"><code>PUBLIC_KEY_FILE=/path/to/file</code></td><td>Optionally specify a file containing the public key (works with docker secrets).</td></tr><tr><tdstyle="text-align: center;"><code>PUBLIC_KEY_DIR=/path/to/directory/containing/_only_/pubkeys</code></td><td>Optionally specify a directory containing the public keys (works with docker secrets).</td></tr><tr><tdstyle="text-align: center;"><code>PUBLIC_KEY_URL=https://github.com/username.keys</code></td><td>Optionally specify a URL containing the public key.</td></tr><tr><tdstyle="text-align: center;"><code>SUDO_ACCESS=false</code></td><td>Set to <code>true</code> to allow <code>linuxserver.io</code>, the ssh user, sudo access. Without <code>USER_PASSWORD</code> set, this will allow passwordless sudo access.</td></tr><tr><tdstyle="text-align: center;"><code>PASSWORD_ACCESS=false</code></td><td>Set to <code>true</code> to allow user/password ssh access. You will want to set <code>USER_PASSWORD</code> or <code>USER_PASSWORD_FILE</code> as well.</td></tr><tr><tdstyle="text-align: center;"><code>USER_PASSWORD=password</code></td><td>Optionally set a sudo password for <code>linuxserver.io</code>, the ssh user. If this or <code>USER_PASSWORD_FILE</code> are not set but <code>SUDO_ACCESS</code> is set to true, the user will have passwordless sudo access.</td></tr><tr><tdstyle="text-align: center;"><code>USER_PASSWORD_FILE=/path/to/file</code></td><td>Optionally specify a file that contains the password. This setting supersedes the <code>USER_PASSWORD</code> option (works with docker secrets).</td></tr><tr><tdstyle="text-align: center;"><code>USER_NAME=linuxserver.io</code></td><td>Optionally specify a user name (Default:<code>linuxserver.io</code>)</td></tr></tbody></table><h3id=volume-mappings-v>Volume Mappings (<code>-v</code>)<aclass=headerlinkhref=#volume-mappings-vtitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Volume</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>/config</code></td><td>Contains all relevant configuration files.</td></tr></tbody></table><h4id=miscellaneous-options>Miscellaneous Options<aclass=headerlinkhref=#miscellaneous-optionstitle="Permanent link">¶</a></h4><table><thead><tr><thstyle="t
</span></code></pre></div><p>Will set the environment variable <code>PASSWORD</code> based on the contents of the <code>/run/secrets/mysecretpassword</code> file.</p><h2id=umask-for-running-applications>Umask for running applications<aclass=headerlinkhref=#umask-for-running-applicationstitle="Permanent link">¶</a></h2><p>For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional <code>-e UMASK=022</code> setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up <ahref=https://en.wikipedia.org/wiki/Umask>here</a> before asking for support.</p><h2id=user-group-identifiers>User / Group Identifiers<aclass=headerlinkhref=#user-group-identifierstitle="Permanent link">¶</a></h2><p>When using volumes (<code>-v</code> flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user <code>PUID</code> and group <code>PGID</code>.</p><p>Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.</p><p>In this instance <code>PUID=1000</code> and <code>PGID=1000</code>, to find yours use <code>id user</code> as below:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-4-1><aid=__codelineno-4-1name=__codelineno-4-1href=#__codelineno-4-1></a><spanclass=w></span>$<spanclass=w></span>id<spanclass=w></span>username
</span></code></pre></div><h2id=docker-mods>Docker Mods<aclass=headerlinkhref=#docker-modstitle="Permanent link">¶</a></h2><p><ahref="https://mods.linuxserver.io/?mod=openssh-server"title="view available mods for this container."><imgalt="Docker Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=openssh-server&query=%24.mods%5B%27openssh-server%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a><ahref="https://mods.linuxserver.io/?mod=universal"title="view available universal mods."><imgalt="Docker Universal Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a></p><p>We publish various <ahref=https://github.com/linuxserver/docker-mods>Docker Mods</a> to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.</p><h2id=support-info>Support Info<aclass=headerlinkhref=#support-infotitle="Permanent link">¶</a></h2><ul><li>Shell access whilst the container is running:</li><li><code>docker exec -it openssh-server /bin/bash</code></li><li>To monitor the logs of the container in realtime:</li><li><code>docker logs -f openssh-server</code></li><li>Container version number</li><li><code>docker inspect -f '{{ index .Config.Labels "build_version" }}' openssh-server</code></li><li>Image version number</li><li><code>docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/openssh-server:latest</code></li></ul><h2id=versions>Versions<aclass=headerlinkhref=#versionstitle="Permanent link">¶</a></h2><ul><li><strong>12.06.23:</strong> - Rebase to Alpine 3.18, deprecate armhf. As announced <ahref=https://www.linuxserver.io/blog/a-farewell-to-arm-hf>here</a></li><li><strong>05.03.23:</strong> - Rebase to Alpine 3.17.</li><li><strong>18.10.22:</strong> - Fix wrong behavior of password/passwordless sudo</li><li><strong>11.10.22:</strong> - Rebase to Alpine 3.16, migrate to s6v3.</li><li><strong>15.09.22:</strong> - add netcat-openbsd with support for proxies.</li><li><strong>18.07.22:</strong> - Fix service perms to comply with upgrade to s6 v3.</li><li><strong>16.04.22:</strong> - Rebase to alpine 3.15.</li><li><strong>16.11.21:</strong> - Add PUBLIC_KEY_URL option</li><li><strong>28.06.21:</strong> - Rebasing to alpine 3.14. Add support for PAM.</li><li><strong>10.02.21:</strong> - Rebasing to alpine 3.13. Add openssh-client for scp.</li><li><strong>21.10.20:</strong> - Implement s6-log for openssh, which adds local timestamps to logs and can be used with a log parser like fail2ban.</li><li><strong>20.10.20:</strong> - Set umask for sftp.</li><li><strong>01.06.20:</strong> - Rebasing to alpine 3.12.</li><li><strong>18.01.20:</strong> - Add key generation script.</li><li><strong>13.01.20:</strong> - Add openssh-sftp-server.</li><li><strong>19.12.19:</strong> - Rebasing to alpine 3.11.</li><li><strong>17.10.19:</strong> - Initial Release.</li></ul><hr><divclass=md-source-file><small> Last update: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">August 31, 2023</span><br> Created: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 22, 2019</span></small></div></article></div></div><buttontype=buttonclass="md-top md-icon"data-md-component=tophidden><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button></main><footerclass=md-footer><navclass="md-footer__inner md-grid"aria-label=Footer><ahref=../docker-ombi