github.com_burnett01_rsync-.../docker-rsync
Steven 0c902521b8
Release/8.0.2 (#93)
* fix: only attempt to create dir if not yet exists

On self-hosted runners it can happen that an action (docker container) is cached. This leads to the script trying to create the .ssh dir despite it already existing. The action then fails.

* fix: only attempt to create file if it doesn't exist yet

On self-hosted runners it can happen that an action (docker container) is cached, resulting in aborting this script because the know_hosts file already exists. 
This if clause fixes it.
Setting permissions is intentionally outside the if clause because in all cases we want to reset perms.

* fix: reverting printf in favor of echo

Like in commit 2c22263 we are using echo again instead of printf because some runners can't function properly with it.

* chore: 8.0.2

* chore: readme changes
2025-12-07 12:59:02 +01:00
..
agent-add v8 - 8.0.0 (#88) 2025-12-06 16:57:20 +01:00
agent-askpass v8 - 8.0.0 (#88) 2025-12-06 16:57:20 +01:00
agent-start v8 - 8.0.0 (#88) 2025-12-06 16:57:20 +01:00
agent-stop v8 - 8.0.0 (#88) 2025-12-06 16:57:20 +01:00
hosts-add Release/8.0.2 (#93) 2025-12-07 12:59:02 +01:00
hosts-clear v8 - 8.0.0 (#88) 2025-12-06 16:57:20 +01:00
hosts-init Release/8.0.2 (#93) 2025-12-07 12:59:02 +01:00
README.md feat: add README for SSH agent and known_hosts management scripts 2025-12-06 19:19:48 +00:00
ssh-init Release/8.0.2 (#93) 2025-12-07 12:59:02 +01:00

Scripts

Shell-scripts to help with managing SSH agents and known hosts files.

SSH Management

ssh-init

This command create the $HOME/.ssh folder with default permissions 700.

SSH-Agent Management

agent-start

This command starts the SSH agent, if it isn't already started (SSH_AGENT_PID set or ssh agent ID file found). It takes one optional argument, for the name of the agent to be started. Defaults to "default". This program needs to be source'd to work correctly. source agent-start "default"

agent-stop

This command stops the SSH agent, if it is started (SSH_AGENT_PID set or ssh agent ID file found). It takes one optional argument, for the name of the agent to be stopped. Defaults to "default". agent-stop "my-agent-name"

agent-add

This command adds a key to the currently running SSH agent. The key is taken from stdin, and the agent used is that in SSH_AGENT_PID.

agent-askpass

This command is called by ssh-add when the SSH_ASKPASS variable is set active. The command returns the SSH_PASS to ssh-askpass(1).

This command is ignored by ssh-add if the key does not require a passphrase.

known_hosts management

hosts-init

This command creates the known_hosts file ($HOME/.ssh/known_hosts) with default permission 600.

hosts-add

This command adds an entry to the known hosts file, and ensures its permissions are correct. It takes one argument, which is the new key to add.

hosts-clear

This command truncates the known_hosts file.