GithubHelp home page GithubHelp logo

ibm / sftp-only-container Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 1.0 20 KB

container files and shell scripts for the IBM Developer tutorial sftp-only container for IBM zCX (or any other appliance-like container runtime). https://developer.ibm.com/tutorials/sharing-volumes-from-the-ibm-zos-container-extension-using-sftp-or-scp/

License: Apache License 2.0

Dockerfile 11.16% Shell 88.84%
docker podman remote ssh sftp ibmz zcx

sftp-only-container's Introduction

sftp-only-container

Scope

container files and shell scripts for the IBM Developer tutorial sftp-only container for IBM zCX (or any other appliance-like container runtime).

Share volumes from the IBM z/OS Container Extension using SFTP on IBM Developer

Usage - Start the container

Requirements

  • IBM Z Container Extension (zCX) - FMID HZDC7C0 - see z/OS 2.5 Requirements for zCX or
  • other remote container runtime (docker or podman) e.g. podman machines on MacOS
  • volume for /home to contain authorized_keys for ssh public key authentication
  • volume for /Volume to host the hub of container volumes to mount onto

Start the container

Here is an example to start the container. The dummy_volume is an example of how to add another container volume to the sftp_only container.

$ docker run --name sftp-only --hostname sftp-only --rm -d -p 2022:22 \
-v sftp-home:/home -v sftp-volume:/Volume -v dummy_volume:/Volume/dummy \
-e SFTP_ONLY=yes thomasw/sftp-only:latest
Environment Variable Values description
SFTP_ONLY yes / no Default: no
Set to yes if the container should restrict the access to sftp, and change the root to /Volume
DEBUG 0 numeric Default: 0 (for no output)
1 or higher is more verbose

Usage User Administration

This can be done on the running container with docker exec or on the /home volume while stopped.

$ docker exec sftp-only containeradm
...

or

$ docker run --rm -v sftp-home:/home thomasw/sftp-only:latest containeradm
...

To get started you need to add a user and add his ssh public key like this:

$ docker exec sftp-only containeradm user add username
User username was added.
$ docker exec sftp-only containeradm key add \
"username:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFHe4Aqe5RbyC1d7Zco+EI9Q4VUvtwcLEHHURK02pe+B test-key"
added key to user username
$

Here is a list of the most important commands:

Task Command
Add a user ... containeradm user add username or
... containeradm user add username:1000:1000
Delete a user ... containeradm user del username
List users ... containeradm user list
Add user to a group ... containeradm user addgrp username groupname
Remove user from a group ... containeradm user rmgrp username groupname
Add ssh public key ... containeradm key "username:ssh-ed25119 AAAA...."
List keys ... containeradm key list username
Dump the ssh config ... containeradm showconfig
Regenerate the hostkeys ... containeradm hostkey refresh

License

The Dockerfiles and associated shell scripts are licensed under the Apache License 2.0

All source files must include a Copyright and License header. The SPDX license header is preferred because it can be easily scanned.

If you would like to see the detailed LICENSE click here.

#
# Copyright 2020- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#

sftp-only-container's People

Contributors

ibm-open-source-bot avatar thomasw64 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

thomasw64

sftp-only-container's Issues

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.