ssh-agent

docksal/ssh-agent Docker Image

自动构建

Docksal的SSH代理服务镜像,提供可被所有容器用户访问的SSH代理套接字,通过socat实现代理套接字(/.ssh-agent/proxy-socket)暴露。

3 次收藏下载次数: 0状态:自动构建维护者:docksal仓库类型:镜像最近更新:
下载命令
点击查看

SSH Agent Docker image for Docksal

This image(s) is part of the Docksal image library.

The exposed ssh-agent socket will be accessible to all users (not only root) in any container.
This is achieved by exposing a proxy socket (/.ssh-agent/proxy-socket) via socat.

Usage

1. Start the ssh-agent container

bash
docker run -d --name=ssh-agent docksal/ssh-agent

2. Add your ssh keys

Replace ~/.ssh with the path to your keys and id_rsa with the key name.
If the key has a passphrase, you will be asked to enter it.

bash
docker run --rm --volumes-from=ssh-agent -v ~/.ssh:/root/.ssh -it ssh-agent ssh-add /root/.ssh/id_rsa

3. Access SSH keys from the ssh-agent in other containers

Mount the ssh-agent socket and set the SSH_AUTH_SOCK variable in other containers.

Docker

bash
docker run --rm --volumes-from=ssh-agent -e SSH_AUTH_SOCK=/.ssh-agent/proxy-socket-it <image> ssh-add -l

Docker Compose

yaml
  ...
  volumes_from:
    - ssh-agent
  ...
  environment:
    - SSH_AUTH_SOCK /.ssh-agent/proxy-socket
  ...

Deleting all keys from the ssh-agent

bash
docker run --rm --volumes-from=ssh-agent -it docksal/ssh-agent ssh-add -D

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 ssh-agent 镜像标签

docker pull docker.xuanyuan.run/docksal/ssh-agent:<标签>

DockerHub 原生拉取命令

docker pull docksal/ssh-agent:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告