Difference between revisions of "Ssh-agent"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "ssh-agent bash -c 'ssh-add /somewhere/yourkey; git clone git@github.com:user/project.git'")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
```
 
ssh-agent bash -c 'ssh-add /somewhere/yourkey; git clone git@github.com:user/project.git'
 
ssh-agent bash -c 'ssh-add /somewhere/yourkey; git clone git@github.com:user/project.git'
 +
```
 +
 +
```
 +
          ssh-agent bash
 +
          ssh-add - <<< $(echo "${{ secrets.PRIVATE_SSH_KEY }}")
 +
          ssh-keyscan -H 10.x.x.x >> ~/.ssh/known_hosts
 +
```
 +
 +
# Windows
 +
 +
```
 +
Start-Service ssh-agent
 +
ssh-add $HOME\.ssh\mysshkey
 +
ssh myremoteuser@myremotehost
 +
```
 +
 +
# Set Lifetime of loaded key
 +
```
 +
ssh-add -t 3600 ~/.ssh/id_rsa
 +
```
 +
 +
# Remove
 +
```
 +
ssh-add -d ~/.ssh/id_rsa  # Remove a specific key
 +
ssh-add -D  # Remove all keys
 +
```

Latest revision as of 10:01, 27 July 2024

ssh-agent bash -c 'ssh-add /somewhere/yourkey; git clone git@github.com:user/project.git'
          ssh-agent bash
          ssh-add - <<< $(echo "${{ secrets.PRIVATE_SSH_KEY }}")
          ssh-keyscan -H 10.x.x.x >> ~/.ssh/known_hosts

Windows

Start-Service ssh-agent
ssh-add $HOME\.ssh\mysshkey
ssh myremoteuser@myremotehost

Set Lifetime of loaded key

ssh-add -t 3600 ~/.ssh/id_rsa

Remove

ssh-add -d ~/.ssh/id_rsa  # Remove a specific key
ssh-add -D  # Remove all keys