Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

urbanobservatory/ubuntu-sshd-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ubuntu-sshd-cron

Schedule regular tasks that require ssh connection for copying files over to the container. Build on top of official Ubuntu image.

DISCLAIMER: Please note that this is for specific use case and not for stable production use.

Installed packages

Base:

Image specific:

Config:

  • default command: cron -f

Example setup

Using Host-Based Authentication:

This expects that you have already setup Host-Based Authentication on your target server. Refer to https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Host-based_Authentication for setting up host-based authentication.

  • generate private and public key pair for your client

    ssh-keygen -t rsa -C "server comment field"
  • create and populate known_hosts file with target host public key

    ssh-keyscan target.example.com | tee -a known_hosts
  • create config file for client ssh (refer to ssh-config)

    Host target
        HostName target.example.com
        Port 22
        User username
        HostbasedAuthentication yes
        EnableSSHKeysign yes
  • Populate target server with client's public key

  • start the container and add the ssh files as a volume

    docker run -it --rm \
    -v "/path_to_ssh_settings:/tmp/.ssh:ro" \
    -v "/my_data_drive:/data:rw" \
    -v "/path_to_script:/etc/cron.daily/script \
    urbanobservatory/ubuntu-sshd-cron

    or

    datacopy:
      image: urbanobservatory/ubuntu-sshd-cron
      restart: unless-stopped
      volumes:
        - ./path_to_ssh_settings:/tmp/.ssh:ro
        - ./my_data_drive:/data:rw
        - ./script.sh:/etc/cron.daily/script

About

Dockerized SSH and Cron service, built on top of official Ubuntu image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published