what password to enter when doing git push?
hey guys. can smb help me out with git? I tried googling but theres no normal and simple answer. the more i read the less i understand.
i did
git commit -m "my message"
.
then when i try to do git push
i get:
what password do i need to enter? can smb explain?35 Replies
⌛
This post has been reserved for your question.
Hey @Fragmented friends! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
That looks like you configured the remote wrong
Do you want to push via HTTPs or via SSH?
no idea 😦 sorry
is there a way to check it?
Well the company should give you instructions for it
the thing before looks like you configured a mix of HTTPs and SSH
or maybe you forgot to setup an SSH key and the company didn't set up the git server that well
so again, is there a way to check if im using http or ssh?
you could check the remote with
git remote get-url origin
the issue is that this URL is probably wrong[email protected]:mycompany/lms/lms.git
this is what i get
ok that's an SSH URL
Did you configure an SSH key?
For SSH URLs, you typically need to set up an SSH key
yes i use ssh to log in into the server
Did you successfully do that before?
I think you can also run
ssh -T [email protected]
to check whether SSH workswhat
that
?why would i need to use this flag?
logging in via SSH
because it's just for testing the connection
and you don't need a terminal for that
ok. but why am i being asked for
git
user's password in the first place?because you don't have an SSH key set up
normally you would have an SSH key which identifies you
what do you mean? i use ssh key to connect to the server
seems like either git/ssh is not recognizing that SSH key or it isn't set up on the server correctly
And because of that, it's asking for a password
oh
SSH allows authentication with a password or with an SSH key but SSH password authentication isn't used by git (at least normally)
and normally, it should generally be disabled for the
git
userwait what. what on earth is ssh password? you either use password to connect to server, or you use ssh key to connect. thats it
That's what I mean. Using a password to connect to a server via SSH isn't used in the context of git
There is probably not even a valid password for that user
Using a password to connect to a server via SSH
that doesnt make sense at allSSH allows multiple modes of authentication:
- SSH keys
- the password of the user
- some other things that are a bit more specific
and it seems like password authentication is just not turned off for git here
wait, so it means that ssh method can use both? keys AND password?
why is it so difficult
keys or password - but with git, it's only the SSH key
if you have an SSH key, you don't need an SSH password
except you password-protect/encrypt the SSH key
I already told you: Either the SSH key isn't set up correctly (e.g. the SSH agent isn't running) on your device or you didn't configure it on the server
wait. now im mixed up. i have ssh key on the
dev2
server,so now i need to have another key pair, right?
you need an SSH key for the server you are connecting to
I think you can also use the same SSH key for multiple servers
but for security reasons, it's recommended to use a distinct SSH key for every server
ohhh. so i need to have two pairs? one pair that is used to connect to
dev2
server, and other pair to connect from dev2
to git.mycompany.lt
server?Are you connecting to the dev2 server and then connecting from the dev2 server to the other server?
i dont know. im on the
dev2
server. and i just want to push from itok yes then you need an SSH key on the dev2 server
and the corresponding public key neesd to be set up on the git server you want to push to
Why didn't your coworkers tell you that???
i dont know. i dont have the patience to work it out. i just spent 3 hours to find out that i just need to generate another ssh keypair
and i will need to put public key on git server, and private in my home dir in
dev2
server?yes
probably in .ssh
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.