Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
a0ac789f
Unverified
Commit
a0ac789f
authored
Oct 11, 2021
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ssh-agent): allow lazy-loading SSH identities (#6309)
Fixes #7477
parent
9bd0ac9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
README.md
plugins/ssh-agent/README.md
+17
-1
ssh-agent.plugin.zsh
plugins/ssh-agent/ssh-agent.plugin.zsh
+4
-1
No files found.
plugins/ssh-agent/README.md
View file @
a0ac789f
...
@@ -21,7 +21,23 @@ zstyle :omz:plugins:ssh-agent agent-forwarding on
...
@@ -21,7 +21,23 @@ zstyle :omz:plugins:ssh-agent agent-forwarding on
----
----
To
**load multiple identities**
use the
`identities`
style, For example:
To
**NOT load any identities on start**
use the
`lazy`
setting. This is particularly
useful when combined with the
`AddKeysToAgent`
setting (available since OpenSSH 7.2),
since it allows to enter the password only on first use. _NOTE: you can know your
OpenSSH version with
`ssh -V`
._
```
zsh
zstyle :omz:plugins:ssh-agent lazy
yes
```
You can enable
`AddKeysToAgent`
by passing
`-o AddKeysToAgent=yes`
to the
`ssh`
command,
or by adding
`AddKeysToAgent yes`
to your
`~/.ssh/config`
file
[
1
]
.
See the
[
OpenSSH 7.2 Release Notes
](
http://www.openssh.com/txt/release-7.2
)
.
----
To
**load multiple identities**
use the
`identities`
style (
**
this has no effect
if the
`lazy`
setting is enabled
**
). For example:
```
zsh
```
zsh
zstyle :omz:plugins:ssh-agent identities id_rsa id_rsa2 id_github
zstyle :omz:plugins:ssh-agent identities id_rsa id_rsa2 id_github
...
...
plugins/ssh-agent/ssh-agent.plugin.zsh
View file @
a0ac789f
...
@@ -96,7 +96,10 @@ else
...
@@ -96,7 +96,10 @@ else
_start_agent
_start_agent
fi
fi
_add_identities
# Don't add identities if lazy-loading is enabled
if
!
zstyle
-b
:omz:plugins:ssh-agent lazy
;
then
_add_identities
fi
unset
agent_forwarding ssh_env_cache
unset
agent_forwarding ssh_env_cache
unfunction _start_agent _add_identities
unfunction _start_agent _add_identities
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment