You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues I encountered with bash integration:
The mc-agent-env file was being created with default permissions instead of specific permissions (yes, umask could be changed, but we're talking defaults here)
The PID of the agent was being printed during login because pgrep was not redirected to /dev/null
The /tmp directory was being littered with agent directories when a logout would terminate the agent
Here is the code snippet I settled on for my .bash_profile:
if ! pgrep -u "$USER" mc-agent > /dev/null; then
#remove old agent directories
find /tmp -name 'moolticute-ssh-agent*' -user ${USER} -type d -prune -exec rm -r {} ';' 2>/dev/null
#create the agent env file with user read/write permissions only
mc-agent | install -m 600 /dev/stdin ~/.mc-agent-env
fi
#send pgrep output to /dev/null so console isn't littered with random PIDs
if pgrep -u "$USER" mc-agent > /dev/null && grep -q 'SSH_AUTH_SOCK=' ~/.mc-agent-env; then
# once mc-agent started successfully override gnome-keyring ssh component
eval "$(<~/.mc-agent-env)"
fi
The text was updated successfully, but these errors were encountered:
There are several issues I encountered with bash integration:
Here is the code snippet I settled on for my .bash_profile:
The text was updated successfully, but these errors were encountered: