You are not logged in.
Pages: 1
Hi there,
I'm currently working on getting ssh-agent running via bashrc and ran into a problem:
Whenever I open a terminal I get the following error:
bash: /run/user/1000/ssh-agent.env: No such file or directoryMy ~/.bashrc:
#
# ~/.bashrc
#
# start ssh-agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")"
fi
# end start ssh agent
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ 'Running
ls $XDG_RUNTIME_DIR I can see that there is no file or directory called ssh-agent.env.
The question is: How can I solve this? Should I just create such a directory or file and what should I put into there?
LinuxShadow
Offline
Not sure if there's a difference, but why don't you install an SSH Server?
Offline
I was also looking into ssh-agent so I tried executing similar lines from the command prompt. The call to ssh-agent (7th line) created the .env file and also started ssh-agent executing. If I rm the .env file and try again then the file is not created since ssh-agent is currently running. Perhaps you have a copy of ssh-agent running?
Offline
Not sure if there's a difference, but why don't you install an SSH Server?
Sorry for the long time it took me to respond, but by looking at your Arch Wiki entry, I don't think I'll require OpenSSH. I don't need a server-client system, I only need an ssh-agent which manages my ssh keys for e.g Git.
Thought I did noticed that after a reboot, the problem does no longer occur and when opening my terminal, the terminal prints "Agent pid ..." on the first line, but it does not save which keys have been stored. All keys which have been stored in the previous session via "ssh-add ~/.ssh/id_rsa" are no longer added to the ssh-agent and have to be re-added.
Offline
it will be less complicated if you use the ~/.ssh/config-file to fit your needs.
Example:
Host gitserver
Hostname git.mydomain.tld
User gituser
Port 1234
PubKeyAuthentication yes
IdentityFile ~/.ssh/gitKey
ForwardX11 no
IdentitiesOnly yesThen you can use e.g. "ssh://gituser@gitserver:/path/to.git to access. Hostname, Port and IdentityFile,gituser must be changed to match your requirements. gitserver is a variable name.
Last edited by koffeinfriedhof (2019-11-19 16:03:02)
Offline
Pages: 1