From cc4ce82ec071f943366f9767efe50aa0d1ae72cf Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Mon, 4 Nov 2024 16:29:00 +0100 Subject: [PATCH] ssh image --- ssh/Containerfile | 11 +++++++++++ ssh/bashrc.sh | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ssh/Containerfile create mode 100644 ssh/bashrc.sh diff --git a/ssh/Containerfile b/ssh/Containerfile new file mode 100644 index 0000000..3670ea8 --- /dev/null +++ b/ssh/Containerfile @@ -0,0 +1,11 @@ +FROM registry.fedoraproject.org/fedora-minimal:40 + +RUN dnf5 install -y openssh-clients bash-completion fzf && \ + dnf5 autoremove -y && \ + dnf5 clean all + +COPY bashrc.sh /root/.bashrc + +WORKDIR /root + +ENTRYPOINT ["/bin/bash", "-c", "echo \"$(ssh-agent -s)\" >/root/ssh_agent_eval && exec bash"] diff --git a/ssh/bashrc.sh b/ssh/bashrc.sh new file mode 100644 index 0000000..fdb66c0 --- /dev/null +++ b/ssh/bashrc.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source /etc/profile +eval "$(cat /root/ssh_agent_eval)"; +source /usr/share/fzf/shell/key-bindings.bash; + +ssh() { + /bin/ssh -o HostKeyAlgorithms=+ssh-dss \ + -o PubkeyAcceptedKeyTypes=+ssh-rsa,ssh-dss \ + "$@" +} +ssh-add -l | grep 'The agent has no identities' && ssh-add