created ssh-agent user systemd unit
ssh-agent is now a user systemd unit and added ./ssh/config to dotfiles
This commit is contained in:
parent
6ea988e0a0
commit
3d6de6bf4b
22
.bashrc
22
.bashrc
@ -4,6 +4,21 @@ export HISTSIZE=-1
|
|||||||
export HISTFILESIZE=-1
|
export HISTFILESIZE=-1
|
||||||
export EDITOR="vim"
|
export EDITOR="vim"
|
||||||
|
|
||||||
|
# used by systemd user unit file ssh-agent in ~/.config/systemd/user/ssh-agent.service
|
||||||
|
#[Unit]
|
||||||
|
#Description=SSH key agent
|
||||||
|
#
|
||||||
|
#[Service]
|
||||||
|
#Type=simple
|
||||||
|
#Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
|
||||||
|
#ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
|
||||||
|
#
|
||||||
|
#[Install]
|
||||||
|
#WantedBy=default.target
|
||||||
|
#
|
||||||
|
#Also add "AddKeysToAgent yes" to ~/.ssh/config
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||||
|
|
||||||
test -s ~/.alias && . ~/.alias || true
|
test -s ~/.alias && . ~/.alias || true
|
||||||
export PATH=~/bin:~/.local/bin:"$PATH"
|
export PATH=~/bin:~/.local/bin:"$PATH"
|
||||||
type go >/dev/null 2>&1 && export GOPATH=$(go env GOPATH) && export PATH="$PATH":$GOPATH/bin
|
type go >/dev/null 2>&1 && export GOPATH=$(go env GOPATH) && export PATH="$PATH":$GOPATH/bin
|
||||||
@ -13,13 +28,6 @@ GPG_TTY=$(tty)
|
|||||||
export GPG_TTY
|
export GPG_TTY
|
||||||
export PWHOME="$HOME/Nextcloud/passwords"
|
export PWHOME="$HOME/Nextcloud/passwords"
|
||||||
|
|
||||||
#make sure we only run one 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
|
|
||||||
|
|
||||||
if [[ -d "$HOME"/.bash_completions.d ]];then
|
if [[ -d "$HOME"/.bash_completions.d ]];then
|
||||||
for file in "$HOME"/.bash_completions.d/*.sh;do
|
for file in "$HOME"/.bash_completions.d/*.sh;do
|
||||||
|
1
.config/systemd/user/default.target.wants/ssh-agent.service
Symbolic link
1
.config/systemd/user/default.target.wants/ssh-agent.service
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/jonas/.config/systemd/user/ssh-agent.service
|
10
.config/systemd/user/ssh-agent.service
Normal file
10
.config/systemd/user/ssh-agent.service
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH key agent
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
|
||||||
|
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
1
.ssh/config
Normal file
1
.ssh/config
Normal file
@ -0,0 +1 @@
|
|||||||
|
Include config.d/*
|
1
.ssh/config.d/common
Normal file
1
.ssh/config.d/common
Normal file
@ -0,0 +1 @@
|
|||||||
|
AddKeysToAgent yes
|
Loading…
Reference in New Issue
Block a user