ssh-add returns with: “Error connecting to agent: No such file or directory”
up vote
4
down vote
favorite
ssh-add
alone is not working:
Error connecting to agent: No such file or directory
How should I use that tool?
linux ssh ssh-agent
|
show 2 more comments
up vote
4
down vote
favorite
ssh-add
alone is not working:
Error connecting to agent: No such file or directory
How should I use that tool?
linux ssh ssh-agent
1
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
1
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
1
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
1
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27
|
show 2 more comments
up vote
4
down vote
favorite
up vote
4
down vote
favorite
ssh-add
alone is not working:
Error connecting to agent: No such file or directory
How should I use that tool?
linux ssh ssh-agent
ssh-add
alone is not working:
Error connecting to agent: No such file or directory
How should I use that tool?
linux ssh ssh-agent
linux ssh ssh-agent
edited Aug 24 at 11:27
Jeff Schaller
36.2k952119
36.2k952119
asked Aug 24 at 7:28
Wong Jia Hau
1295
1295
1
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
1
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
1
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
1
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27
|
show 2 more comments
1
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
1
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
1
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
1
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27
1
1
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
1
1
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
1
1
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
1
1
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27
|
show 2 more comments
3 Answers
3
active
oldest
votes
up vote
8
down vote
accepted
You need to initialize the agent first.
ssh-agent bash
2
Thanks it works for me! Since I'm usingfish
, the command isssh-agent fish
.
– Wong Jia Hau
Aug 24 at 7:43
add a comment |
up vote
4
down vote
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly SSH_AUTH_SOCK
), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
eval "$(ssh-agent)"
or start a new shell session through the agent using
ssh-agent fish
But since you say that you used to be able to use ssh-add
without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the SSH_AUTH_SOCK
environment variable is actually set, but that ssh-add
can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
add a comment |
up vote
0
down vote
In windows power shell:
- Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
- Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
- Start it: "Start-Service ssh-agent"
- Add your key as before: "ssh-add"
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
You need to initialize the agent first.
ssh-agent bash
2
Thanks it works for me! Since I'm usingfish
, the command isssh-agent fish
.
– Wong Jia Hau
Aug 24 at 7:43
add a comment |
up vote
8
down vote
accepted
You need to initialize the agent first.
ssh-agent bash
2
Thanks it works for me! Since I'm usingfish
, the command isssh-agent fish
.
– Wong Jia Hau
Aug 24 at 7:43
add a comment |
up vote
8
down vote
accepted
up vote
8
down vote
accepted
You need to initialize the agent first.
ssh-agent bash
You need to initialize the agent first.
ssh-agent bash
answered Aug 24 at 7:41
Panki
42719
42719
2
Thanks it works for me! Since I'm usingfish
, the command isssh-agent fish
.
– Wong Jia Hau
Aug 24 at 7:43
add a comment |
2
Thanks it works for me! Since I'm usingfish
, the command isssh-agent fish
.
– Wong Jia Hau
Aug 24 at 7:43
2
2
Thanks it works for me! Since I'm using
fish
, the command is ssh-agent fish
.– Wong Jia Hau
Aug 24 at 7:43
Thanks it works for me! Since I'm using
fish
, the command is ssh-agent fish
.– Wong Jia Hau
Aug 24 at 7:43
add a comment |
up vote
4
down vote
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly SSH_AUTH_SOCK
), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
eval "$(ssh-agent)"
or start a new shell session through the agent using
ssh-agent fish
But since you say that you used to be able to use ssh-add
without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the SSH_AUTH_SOCK
environment variable is actually set, but that ssh-add
can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
add a comment |
up vote
4
down vote
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly SSH_AUTH_SOCK
), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
eval "$(ssh-agent)"
or start a new shell session through the agent using
ssh-agent fish
But since you say that you used to be able to use ssh-add
without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the SSH_AUTH_SOCK
environment variable is actually set, but that ssh-add
can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
add a comment |
up vote
4
down vote
up vote
4
down vote
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly SSH_AUTH_SOCK
), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
eval "$(ssh-agent)"
or start a new shell session through the agent using
ssh-agent fish
But since you say that you used to be able to use ssh-add
without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the SSH_AUTH_SOCK
environment variable is actually set, but that ssh-add
can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly SSH_AUTH_SOCK
), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
eval "$(ssh-agent)"
or start a new shell session through the agent using
ssh-agent fish
But since you say that you used to be able to use ssh-add
without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the SSH_AUTH_SOCK
environment variable is actually set, but that ssh-add
can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
edited 2 days ago
answered Aug 24 at 7:52
Kusalananda
116k15218352
116k15218352
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
add a comment |
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
Yes, I think I killed the agent accidentally, perhaps due to restarting the machine.
– Wong Jia Hau
Aug 24 at 8:26
add a comment |
up vote
0
down vote
In windows power shell:
- Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
- Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
- Start it: "Start-Service ssh-agent"
- Add your key as before: "ssh-add"
add a comment |
up vote
0
down vote
In windows power shell:
- Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
- Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
- Start it: "Start-Service ssh-agent"
- Add your key as before: "ssh-add"
add a comment |
up vote
0
down vote
up vote
0
down vote
In windows power shell:
- Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
- Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
- Start it: "Start-Service ssh-agent"
- Add your key as before: "ssh-add"
In windows power shell:
- Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
- Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
- Start it: "Start-Service ssh-agent"
- Add your key as before: "ssh-add"
edited Oct 16 at 16:57
Jeff Schaller
36.2k952119
36.2k952119
answered Oct 16 at 16:27
Chris
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464574%2fssh-add-returns-with-error-connecting-to-agent-no-such-file-or-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Dear moderators, I was ask to moved this question to this site from StackOverflow, but then I got downvote again? Can you at least tell me why?
– Wong Jia Hau
Aug 24 at 7:45
I'm not a moderator, but simply googling the error message would have given you an answer. stackoverflow.com/questions/17846529/…
– Panki
Aug 24 at 7:56
1
@Panki I tried that solution, it doesn't work, so I came to ask a new question.
– Wong Jia Hau
Aug 24 at 8:01
1
Please read our FAQ, take the tour and lurk for a while to get a feel of the forum use.
– Rui F Ribeiro
Aug 24 at 8:07
1
Thank you for all the moderators who helped me to improve this questions!
– Wong Jia Hau
Aug 24 at 12:27