After the default ssh port is changed, how can I use git normally ?, Sshgit

Source: Internet
Author: User
Tags ssh port

After the default ssh port is changed, how can I use git normally ?, Sshgit

For security or other reasons, we may modify the default SSH service port number. By default, the existing git project reports an error during pull or push.

Now assume that the remote settings of the original project areGit@domain.com: Projects/p1.gitWhen the default port of SSH on the server is changed to 3022, a push error occurs.

There are two solutions:

1. directly change the URL to start with SSH: //
Git remote set-url origin ssh: // git@domain.com: 3022 /~ /Projects/p1.git
2. Modify the local configuration file
Cat> ~ /. Ssh/config # map an alias host newdomainhostname domain. comport 3022 # ctrl + D

Modify the git configuration file under the p1.git Project

Git remote set-url origin git @ newdomain: Projects/p1.git

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.