LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-20-2020, 06:29 PM   #16
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,927

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674

Quote:
Originally Posted by apoorv569 View Post
during the whole process i mean and in the config file you told me to make
Setting up SSH does not require your username anywhere only in the config file I posted earlier. I do not know what else to tell you. If you want you can try deactivating the firewall for a few seconds and try to connect to the server. If that does not help then maybe start from scratch. As I said, the procedure is pretty much straight forward and I had no trouble making it work.
 
Old 06-20-2020, 06:34 PM   #17
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Setting up SSH does not require your username anywhere only in the config file I posted earlier. I do not know what else to tell you. If you want you can try deactivating the firewall for a few seconds and try to connect to the server. If that does not help then maybe start from scratch. As I said, the procedure is pretty much straight forward and I had no trouble making it work.
not setting up ssh the config you sent to make in ~/.ssh/config you said to enter my gitlab username im talking about that. i followed every step as is
 
Old 06-21-2020, 01:55 AM   #18
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Setting up SSH does not require your username anywhere only in the config file I posted earlier. I do not know what else to tell you. If you want you can try deactivating the firewall for a few seconds and try to connect to the server. If that does not help then maybe start from scratch. As I said, the procedure is pretty much straight forward and I had no trouble making it work.
i was able to add the key i was doing this
Code:
 ssh -T apoorv569@gitlab.com
and actually had to do this
Code:
 ssh -T git@gitlab.com
but when i git push it still asks for my username and password for gitlab.com how can i change ssh method rather than https
 
Old 06-21-2020, 03:15 AM   #19
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,923
Blog Entries: 9

Rep: Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214
Maybe it's in your repo's .git/config.

I always push my local objects to 2 sites.

The .git/config's of all my repos look like this:
Code:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@gitlab.com:ondoho/some_repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = git@github.com:ondoho/some_repo.git
pushurl = git@gitlab.com:ondoho/some_repo.git
[branch "master"]
remote = origin
merge = refs/heads/master
I think it's the [remote] section that matters most.
git@ means ssh.

So,
step 1: understand ssh
step 2: fix ssh push'n'pull for your repos (you also need to give gitlab/github your public key)
step 3: set up pushing to / pulling from multiple mirrors
 
Old 06-21-2020, 03:49 AM   #20
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
Maybe it's in your repo's .git/config.

I always push my local objects to 2 sites.

The .git/config's of all my repos look like this:
Code:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@gitlab.com:ondoho/some_repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = git@github.com:ondoho/some_repo.git
pushurl = git@gitlab.com:ondoho/some_repo.git
[branch "master"]
remote = origin
merge = refs/heads/master
I think it's the [remote] section that matters most.
git@ means ssh.

So,
step 1: understand ssh
step 2: fix ssh push'n'pull for your repos (you also need to give gitlab/github your public key)
step 3: set up pushing to / pulling from multiple mirrors
i did this to change HTTPS TO SSH
Code:
 config remote set-url origin git@gitlab.com:USERNAME/REPOSITORY
and its working, but its asks for the passphrase everytime i try to push or pull. same as HTTP (username & password). im using a git bare repo as instructed on Distrotube's youtube video about git bare repository. so i have set alias config to git

Last edited by apoorv569; 06-21-2020 at 03:51 AM.
 
Old 06-21-2020, 05:58 AM   #21
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,927

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by apoorv569 View Post
i was able to add the key i was doing this
Code:
 ssh -T apoorv569@gitlab.com
and actually had to do this
Code:
 ssh -T git@gitlab.com
but when i git push it still asks for my username and password for gitlab.com how can i change ssh method rather than https
This is exactly what I already told you in post #10! You should read the questions guideline on what information is required when asking a question. So far you have been quite vague on what you did. You just broadly state that you did as required but it does not work. But you did not as required, just as was the case after my post #10.
You need to post everything that you typed verbatim. The only thing that you do not post are passwords - type a few xxxxxxxxx for passwords.

The following is the same situation as we already had after post #10. You say that you did everything as per instructions but you did not.
Quote:
Originally Posted by apoorv569 View Post
but its asks for the passphrase everytime i try to push or pull. same as HTTP (username & password)
Do you see how you contradict yourself just a few words apart? Asking for passphrase is NOT the same as asking for username & password.

I am going to consult my crystal ball one last time in this matter. Here is what you did:
You created a key pair with ssh-keygen

Code:
# ssh-keygen -t rsa -b 2048 -C "whatever"
As response you got
Code:
# ssh-keygen -t rsa -b 2048 -C "whatever"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
...
You left the field for the keyname empty, thus accepting the default, which is fine. However, when asked for a passphrase you entered your gitlab password. This is NOT required. The password that ssh-keygen asks for is to unlock your local private key on your local machine! It can be anything you want. You will have to enter that password everytime you push to gitlab.com, unless you leave those fields empty. If left empty, then git will not ask for a password. Again, this password is meant for your private key only! Whether you want to protect your private key with an additional password or leave it as is, is entirely up to you and how much you trust your own setup.

The crystal ball is exhausted now and needs to rest. If you require further assistance you will have to be a lot more precise with your problem description.
 
Old 06-21-2020, 07:59 AM   #22
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
This is exactly what I already told you in post #10! You should read the questions guideline on what information is required when asking a question. So far you have been quite vague on what you did. You just broadly state that you did as required but it does not work. But you did not as required, just as was the case after my post #10.
You need to post everything that you typed verbatim. The only thing that you do not post are passwords - type a few xxxxxxxxx for passwords.

The following is the same situation as we already had after post #10. You say that you did everything as per instructions but you did not.


Do you see how you contradict yourself just a few words apart? Asking for passphrase is NOT the same as asking for username & password.

I am going to consult my crystal ball one last time in this matter. Here is what you did:
You created a key pair with ssh-keygen

Code:
# ssh-keygen -t rsa -b 2048 -C "whatever"
As response you got
Code:
# ssh-keygen -t rsa -b 2048 -C "whatever"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
...
You left the field for the keyname empty, thus accepting the default, which is fine. However, when asked for a passphrase you entered your gitlab password. This is NOT required. The password that ssh-keygen asks for is to unlock your local private key on your local machine! It can be anything you want. You will have to enter that password everytime you push to gitlab.com, unless you leave those fields empty. If left empty, then git will not ask for a password. Again, this password is meant for your private key only! Whether you want to protect your private key with an additional password or leave it as is, is entirely up to you and how much you trust your own setup.

The crystal ball is exhausted now and needs to rest. If you require further assistance you will have to be a lot more precise with your problem description.
dude i made 1 mistake that is i typed my username instead of git when checking i.e.
Code:
 ssh -T apoorv569@gitlab.com
instead of
Code:
 ssh -T git@gitlab.com
why create a issue about it.

and
Quote:
but its asks for the passphrase everytime i try to push or pull. same as HTTP (username & password)
by this i mean its the same as before when i was using HTTPS, i had to enter my username and password. with SSH also i need to enter the passphrase.

and i know the difference between a SSH passphrase and a gitlab account passoword

I want to use SSH so that i don't have to enter a "password" or "passphrase". i guess that's the whole point of using SSH and that its more secure than HTTP.

I'm new to git not computers, Linux or this world.

you are not helpful at all, all the questions that i asked you i did not got any answer from you i searched on internet myself to find the answers and i put them here in-case anyone later reading this thread will get some help instead of this stupid conversation.

and there are ways for when i want to push or pull i wont get asked for my passphrase, which you might or might not know, and i will find that way with or without your help.

so unless you can answer the question which let me state it again

WHEN I TRY TO PUSH OR PULL TO MY GITLAB, I GET ASKED FOR THE SSH-PASSPHRASE EVERYTIME, IS THERE A WAY TO CHANGE THIS BEHAVIOR.
 
Old 06-21-2020, 09:01 AM   #23
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by apoorv569 View Post
dude i made 1 mistake that is i typed my username instead of git when checking i.e.
Code:
 ssh -T apoorv569@gitlab.com
instead of
Code:
 ssh -T git@gitlab.com
why create a issue about it.

and
by this i mean its the same as before when i was using HTTPS, i had to enter my username and password. with SSH also i need to enter the passphrase.

and i know the difference between a SSH passphrase and a gitlab account passoword

I want to use SSH so that i don't have to enter a "password" or "passphrase". i guess that's the whole point of using SSH and that its more secure than HTTP.

I'm new to git not computers, Linux or this world.

you are not helpful at all, all the questions that i asked you i did not got any answer from you i searched on internet myself to find the answers and i put them here in-case anyone later reading this thread will get some help instead of this stupid conversation.

and there are ways for when i want to push or pull i wont get asked for my passphrase, which you might or might not know, and i will find that way with or without your help.

so unless you can answer the question which let me state it again

WHEN I TRY TO PUSH OR PULL TO MY GITLAB, I GET ASKED FOR THE SSH-PASSPHRASE EVERYTIME, IS THERE A WAY TO CHANGE THIS BEHAVIOR.
i solved my problem all by myself, when doing this
Code:
 ssh -T git@gitlab.com
it creates a key fingerprint for ECDSA but i generated an RSA SSH key
Code:
The authenticity of host 'gitlab.com (172.65.251.78)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
so according to this site, i added this manually in known_hosts file in the .ssh folder
Code:
gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9
and then i did
Code:
eval $(ssh-agent)
then
Code:
ssh-add ~/.ssh/id_rsa
and now im able to push and pull with entering the passpharse. i have added this before also but it was not working. after changing the known_hosts file and adding RSA key fingerprint manually rather than ECDSA. it works now.
 
Old 06-21-2020, 09:35 AM   #24
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,927

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by apoorv569 View Post
dude i made 1 mistake that is i typed my username instead of git when checking i.e.
Code:
ssh -T apoorv569@gitlab.com
instead of
Code:
ssh -T git@gitlab.com
No, you made more mistakes, otherwise it would be working. I already told you, the documentation I referred you to is pretty much straight forward, although NOT trivial. I was able to setup an account and push to it with SSH access in 5 minutes (behind a firewall). The documentation is correct.
Quote:
Originally Posted by apoorv569 View Post
why create a issue about it.
You are the one creating the issues by providing incomplete/false information.

Quote:
Originally Posted by apoorv569 View Post
I'm new to git not computers, Linux or this world.
That does not say anything about your level of competence. Every day I go out and see cars driving around. This does not make me a car expert.

Quote:
Originally Posted by apoorv569 View Post
you are not helpful at all, all the questions that i asked you i did not got any answer from you
Wrong again. You already stated that you did not apply the procedure that I recommended in post #10. Just because you do not understand the answer does not invalidate the answer. I also gave you the answer on what you can use as <source-name> in post #5.

Quote:
Originally Posted by apoorv569 View Post
i searched on internet myself to find the answers and i put them here in-case anyone later reading this thread will get some help ...
You did not put any answers here you just vaguely stated that you applied some procedures, which turns out you did not apply properly.
Quote:
Originally Posted by apoorv569 View Post
... instead of this stupid conversation.
Stupid is who stupid does.

Quote:
Originally Posted by apoorv569 View Post
and there are ways for when i want to push or pull i wont get asked for my passphrase, which you might or might not know, and i will find that way with or without your help.
Good luck.

Quote:
Originally Posted by apoorv569 View Post
so unless you can answer the question which let me state it again
WHEN I TRY TO PUSH OR PULL TO MY GITLAB, I GET ASKED FOR THE SSH-PASSPHRASE EVERYTIME, IS THERE A WAY TO CHANGE THIS BEHAVIOR.
I already did. The documentation I linked is accurate. Again, the information of what you have done has been incomplete/wrong so far.

Last edited by crts; 06-21-2020 at 10:18 AM.
 
Old 06-21-2020, 10:24 AM   #25
apoorv569
Member
 
Registered: Jun 2020
Distribution: Arch Linux
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
No, you made more mistakes, otherwise it would be working. I already told you, the documentation I referred you to is pretty much straight forward, although NOT trivial. I was able to setup an account and push to it with SSH access in 5 minutes (behind a firewall). The documentation is correct.

You are the one creating the issues by providing incomplete/false information.



That does not say anything about your level of competence. Every day I go out and see cars driving around. This does not make me a car expert.


Wrong again. You already stated that you did not apply the procedure that I recommended in post #10. Just because you do not understand the answer does not invalidate the answer. I also gave you the answer on what you can use as <source-name> in post #5.


You did not put any answers here you just vaguely stated that you applied some procedures, which turns out you did not apply properly.

Stupid is who stupid does.


Good luck.


I already did. The documentation I linked is accurate. Again, the information of what you have done has been incomplete/wrong so far.
i want you to state all the mistakes i made during this entire thread numbered. quick im waiting
 
Old 06-21-2020, 10:48 AM   #26
onebuck
Moderator
 
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: Slackware®
Posts: 13,576
Blog Entries: 34

Rep: Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768Reputation: 2768
Moderator Response

Let's calm down!
LQ Rules
Quote:
  • Personal attacks on others will not be tolerated.
  • Flame Wars will not be tolerated.
  • Do not post if you do not have anything constructive to say in the post.
  • When posting in an existing thread, ensure that what you're posting is on-topic and relevant to the thread. If the content of your post will interfere with the current discussion, you should start a new thread.

Last edited by onebuck; 06-21-2020 at 10:49 AM. Reason: typo
 
Old 06-21-2020, 12:14 PM   #27
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,927

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by apoorv569 View Post
.. when doing this
Code:
 ssh -T git@gitlab.com
it creates a key fingerprint for ECDSA but i generated an RSA SSH key
This command does not create a fingerprint. The ECDSA key is gitlab's key. This is the key that gitlab uses to identify itself. It has nothing to do with your RSA key.

Quote:
Originally Posted by apoorv569 View Post
Code:
The authenticity of host 'gitlab.com (172.65.251.78)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
This just asks you to confirm that you really want to connect to gitlab.com. SSH does this once when you connect to a new server. You could have just answered 'yes' and it would have added gitlab.com to its known_hosts automatically.
I do not know why you think this was the issue in the first place because in post #8 you clearly state that you were already past that stage!
Quote:
Originally Posted by apoorv569 View Post
then i got an output something like this
Code:
The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.com' (ECDSA) to the list of known hosts.
git@gitlab.com: Permission denied (publickey).
i saw 1 video on youtube the person did the exact same thing he didn't get error.
pretty sure .pub file is a public key
The error clearly indicates that there is a problem with your public key and not with known_hosts or with username/password as you stated twice earlier.

Quote:
Originally Posted by apoorv569 View Post
i want you to state all the mistakes i made during this entire thread numbered. quick im waiting
That is an exercise in futility, so you can wait all you want. You do not provide all the information to pinpoint the exact problem, just some snippets. You state that you followed instructions but "it no worky, worky" somehow. The result speaks for itself. If it does not work then you DID make a mistake somewhere. Your entire posting style is indicative for that. Your problem description is vague and you do not use proper capitalization. You put little effort in your posts and that is usually consistent with an overall sloppy work attitude:
Quote:
Originally Posted by apoorv569 View Post
... and now im able to push and pull with entering the passpharse.
I am just going to assume that you actually meant without entering the passphrase, you probably just did not pay attention ...

Your problem description has been quite erratic. And to top it all off, you state that the provided answers are somehow at fault, even though you have already admitted that the answers were helpful on at least two occasions. That is just slanderous.
 
  


Reply

Tags
git, gitlab, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Gitpod git-bolts git-IDE onto GitHub for in-browser code git-editing LXer Syndicated Linux News 0 09-05-2018 04:50 AM
[SOLVED] cvs [commit aborted]: 'root' is not allowed to commit files Joaquin Linux - Software 5 11-28-2013 05:48 AM
cvs [commit aborted]: 'root' is not allowed to commit files rakesh@linuxforum Linux - Newbie 7 09-26-2013 03:53 PM
[SOLVED] Can't install Git repo (I don't git git ) Nemus Linux - Software 3 05-20-2011 02:09 PM
cvs [commit aborted]: 'root' is not allowed to commit files r_ramya06 Linux - Newbie 5 07-08-2008 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration