Answer the question
In order to leave comments, you need to log in
How to create 2 SSH keys?
Hello!
There is a gulp collector. There is a project. It is necessary that when the project file is changed, it is automatically sent to the ftp server. I use gulp-rsync for this. Each time you make a change, the terminal asks you to enter a password. I read that to bypass this, you need to create an ssh key. Created according to the instructions - everything works.
The problem is that there is another project. And when I create a key for it, it turns out that one overwrites the other. Now the second project does not need a password, the first one does.
I tried to create a key with a different name, but it didn't work. As if some kind of mistake and the password as requested, and asks.
Below is the working code without changing the name:
cd ~/.ssh
ssh-keygen (после этого жму ENTER ENTER ENTER без ввода имени)
scp -p id_rsa.pub [email protected]:~
ssh [email protected]
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
rm -f ~/id_rsa.pub
logout
eval `ssh-agent -s`
ssh-add
cd ~/.ssh
ssh-keygen (после этого ввожу имя id_rsa_COMPANY)
scp -p id_rsa_COMPANY.pub [email protected]:~
ssh [email protected]
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat id_rsa_COMPANY.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
rm -f ~/id_rsa_COMPANY.pub
logout
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa_COMPANY
Answer the question
In order to leave comments, you need to log in
Try using one ssh for two projects.
I use one ssh for gulp-rsync and for github
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question