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