简体   繁体   中英

SSH push to git from remote server

I am having a hard time with the following situation: We have a remote virtual server where we store our website files, I access this server through ssh connection in ubuntu terminal. On my current desktop ubuntu I have 2 ssh keys as it should be - one public and one private. In Git I have added my public key from my local machine. If I try to connect like this:

ssh git@gitlab.DOMAIN.com
PTY allocation request failed on channel 0
Welcome to GitLab, X X!
Connection to gitlab.DOMAIN.com closed.

If I connect to our remote server and try to perform git push git is asking me to provide a password for account git@gitlab.DOMAIN.com ?

Can you give me some directions as to where I am going wrong and how to handle this?

Regards

If I understand your question correctly. You are able to connect to the gitlab server from your local machine but git push fails from your remote server. You need to also set the keys for your push on the remote server. You can either copy the .ssh/ directory to the home directory on the remote server so that it uses your keys.

Your connection to the remote server does not have access to your keys so it is being treated like any anonymous push and gitlab is trying to verify who you are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM