Sign inSign up

mfairul/file_transfer_using_scp

By mfairul

•Updated almost 6 years ago

Image
0

1.0K

mfairul/file_transfer_using_scp repository overview

⁠ssh-docker

  • SSH, SCP, Rsync services in a Docker container.

⁠Authorized Keys:

  • This container only accepts ssh-key auth.

You must put at least 1 valid public key in './files/' before building.

Anything matching ./files/*.pub will be added to /etc/authorized_keys before sshd starts.

Edit /etc/authorized_keys to modify keys after container is running.

⁠Basic Installation:

  1. Install Docker⁠
  2. Clone this repo: git clone https://github.com/jhazelwo/ssh-docker.git
  3. Copy your public key cp ~/.ssh/id_rsa.pub ./ssh-docker/files/
  4. Build the image cd ssh-docker; ./Build.sh
  5. Start a container from that image. ./Go.sh

⁠Config:

⁠Usage Examples:

⁠Put (rsync)

rsync -av --progress -e 'ssh -p 22022 -l data -i ~/.ssh/id_rsa' remote.host.tld:*.zip .

⁠Get (rsync)

rsync -av --progress -e 'ssh -p 22022 -l data -i ~/.ssh/id_rsa' *.zip remote.host.tld:.

⁠Shell

ssh -l data -p 22022 -i ~/.ssh/id_rsa remote.host.tld

⁠Put (scp)

scp -P 22022 -i ~/.ssh/id_rsa *.zip [email protected]:. note: Use upper-case P for 'Port' when using scp.

⁠Get (scp)

scp -P 22022 -i ~/.ssh/id_rsa [email protected]:*.zip . note: Use upper-case P for 'Port' when using scp.

⁠~/.ssh/config
# If you put key, user and port in ~/.ssh/config you don't  have to 
# include them in your commands.
Host remote.host.tld
    HostName remote.host.tld
    User data
    IdentityFile ~/.ssh/remote_host_PRIVATE_key
    Port 22022

Tag summary

Content type

Image

Digest

Size

204.1 MB

Last updated

almost 6 years ago

docker pull mfairul/file_transfer_using_scp