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:
banana@dev2:/var/www/lms2$ git push
[email protected]'s password:
banana@dev2:/var/www/lms2$ git push
[email protected]'s password:
what password do i need to enter? can smb explain?
35 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Fragmented friends! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2mo ago
That looks like you configured the remote wrong Do you want to push via HTTPs or via SSH?
bambyzas
bambyzasOP2mo ago
no idea 😦 sorry is there a way to check it?
dan1st
dan1st2mo ago
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
bambyzas
bambyzasOP2mo ago
so again, is there a way to check if im using http or ssh?
dan1st
dan1st2mo ago
you could check the remote with git remote get-url origin the issue is that this URL is probably wrong
bambyzas
bambyzasOP2mo ago
[email protected]:mycompany/lms/lms.git this is what i get
dan1st
dan1st2mo ago
ok that's an SSH URL Did you configure an SSH key? For SSH URLs, you typically need to set up an SSH key
bambyzas
bambyzasOP2mo ago
yes i use ssh to log in into the server
dan1st
dan1st2mo ago
Did you successfully do that before? I think you can also run ssh -T [email protected] to check whether SSH works
bambyzas
bambyzasOP2mo ago
what that?
bambyzas
bambyzasOP2mo ago
why would i need to use this flag?
No description
dan1st
dan1st2mo ago
logging in via SSH because it's just for testing the connection and you don't need a terminal for that
bambyzas
bambyzasOP2mo ago
ok. but why am i being asked for git user's password in the first place?
dan1st
dan1st2mo ago
because you don't have an SSH key set up normally you would have an SSH key which identifies you
bambyzas
bambyzasOP2mo ago
what do you mean? i use ssh key to connect to the server
dan1st
dan1st2mo ago
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
bambyzas
bambyzasOP2mo ago
oh
dan1st
dan1st2mo ago
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 user
bambyzas
bambyzasOP2mo ago
wait what. what on earth is ssh password? you either use password to connect to server, or you use ssh key to connect. thats it
dan1st
dan1st2mo ago
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
bambyzas
bambyzasOP2mo ago
Using a password to connect to a server via SSH that doesnt make sense at all
dan1st
dan1st2mo ago
SSH 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
bambyzas
bambyzasOP2mo ago
wait, so it means that ssh method can use both? keys AND password? why is it so difficult
dan1st
dan1st2mo ago
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
bambyzas
bambyzasOP2mo ago
wait. now im mixed up. i have ssh key on the dev2 server,
No description
bambyzas
bambyzasOP2mo ago
so now i need to have another key pair, right?
dan1st
dan1st2mo ago
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
bambyzas
bambyzasOP2mo ago
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?
dan1st
dan1st2mo ago
Are you connecting to the dev2 server and then connecting from the dev2 server to the other server?
bambyzas
bambyzasOP2mo ago
i dont know. im on the dev2 server. and i just want to push from it
dan1st
dan1st2mo ago
ok 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???
bambyzas
bambyzasOP2mo ago
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?
dan1st
dan1st2mo ago
yes probably in .ssh
JavaBot
JavaBot2mo ago
💤 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.
Want results from more Discord servers?
Add your server