Boa tarde.
Eu criei uma instância na AWS, criei um novo par de chave.pem e armazenei na ~/.ssh e configurei o security group aberto SHH para o meu IP, HTTP e HTTPS ipv4 e ipv6 e coloquei um IP elástico na aplicação. Consegui entrar normalmente utilizando aquele comando que a amazon informa para conexão SSH. Entretanto, eu queria configurar uma pasta no meu servidor para ser um repositório que recebe todas os push da minha máquina.
portanto, eu fiz os seguintes procedimentos:
- Criei uma pasta repo-agenda no meu EC2
- Entrei na pasta e fiz o comando git init --bare
- Agora na minha máquina, eu peguei a pasta do meu projeto
Tente de duas maneiras diferentes:
- git remote add agenda ubuntu@:new-repo
- git remote add agenda2 ubuntu@:repo-agenda
Quando fui dar git push -u (agenda ou agenda2) master
ERRO 1:
The authenticity of host 'ip-elastico
(ip-elastico)' can't be established. ED25519 key fingerprint is
SHA. This host key is known by the following other names/addresses: ~/.ssh/known_hosts:5: [hashed name] Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'ip-elastico
' (ED25519) to the list of known hosts.
ubuntu@ip-elastico`: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
ERRO 2:
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA
.
Please contact your system administrator.
Add correct host key in /home/piotto/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/piotto/.ssh/known_hosts:7
remove with:
ssh-keygen -f "/home/piotto/.ssh/known_hosts" -R "DNS
"
Host key for DNS
has changed and you have requested strict checking.
Host key verification failed.