0

I'd like to use git clone https://... without using username and password, it doesn't work on my server.

Command : sudo git clone https://gitlab.com/****/****.git

Issue : They ask me the username and password.

Using SSH, they ask me the passphrase, and I don't want to input something after git clone.

Any ideas?

Edit #1

Command : sudo ssh-keygen -p -P "myoldpassword" -n "" -f /root/.ssh/id_rsa.pub

Result :

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/id_rsa.pub
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/id_rsa.pub
Bad passphrase.
2
  • 2
    If it's a private or otherwise access-restricted repository, not much else you can do besides configure SSH access. Do you have that enabled?
    – Makoto
    Commented Sep 29, 2016 at 15:25
  • Yes, it's a private repository. And yes I have SSH enabled, but with a passphrase and I don't want them...
    – tonymx227
    Commented Sep 29, 2016 at 15:27

2 Answers 2

1

Using SSH, they ask me the passphrase, and I don't want to input something after git clone

To remove the passphrase from your ssh key you need to run

$ ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]

There is also the option of using ssh-agent, which can cache the passphrase for some time.

0
0

Just use chmod 400 /root/.ssh/id_rsa.pub. This will make your key read-only, and will allow you to use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.