How to configure ssh to log in to Linux using git bash

How to configure ssh to log in to Linux using git bash

1. First, generate the public key and private key files on the Linux server. The default storage directory is ~/.ssh.

ssh-keygen

You can leave the password blank to log in without a password in the future.

2. Copy the private key file to your local computer.

scp [email protected]:/root/.ssh/id_rsa ~/.ssh

It is best to put the private key file in the ~/.ssh directory. Otherwise, when logging in using ssh, you need to use -i to specify the private key file.

3. The public key file needs to be added to the server's ~/.ssh/authorized_keys file.

cat id_rsa.pub >> authorized_keys

4. Modify the configuration file to allow login using a secret key.

vim /etc/ssh/sshd_config

Just remove the # before the comment.

Then restart the Linux ssh service

systemctl restart sshd.service

Older versions without systemctl need to use service sshd restart

You can use ssh [email protected] to log in:

The above article about how to configure git bash to log in to Linux through ssh is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • How to configure IDEA for the first time and import Gite code cloud
  • Pycharm configuration git (graphic tutorial)
  • Detailed explanation of Git configuration and collaborative development in Android Studio
  • Git ssh configuration and usage
  • Detailed illustration of Git client: How to install and configure GitHub operation process guide
  • Detailed explanation of Git configuration and file transfer method
  • Java course design to make a multi-person chat room (socket + multi-threading)

<<:  Detailed installation process of MySQL 8.0 Windows zip package version

>>:  ByteDance interview: How to use JS to implement Ajax concurrent request control

Recommend

Summary of HTML horizontal and vertical centering issues

I have encountered many centering problems recent...

Tutorial on customizing rpm packages and building yum repositories for Centos

1 Keep the rpm package downloaded when yum instal...

Detailed explanation of JavaScript Proxy object

Table of contents 1. What is Proxy? 2. How to use...

A brief discussion on value transfer between Vue components (including Vuex)

Table of contents From father to son: Son to Fath...

Share 20 excellent web form design cases

Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...

JQuery implements hiding and displaying animation effects

This article shares the specific code of JQuery t...

Use of VNode in Vue.js

What is VNode There is a VNode class in vue.js, w...

Implementation of Docker deployment of SQL Server 2019 Always On cluster

Table of contents Docker deployment Always on clu...

Use of filter() array filter in JS

Table of contents 1. Introduction 2. Introduction...

uniapp implements date and time picker

This article example shares the specific code of ...

Solve the mysql user deletion bug

When the author was using MySQL to add a user, he...

An article to help you learn CSS3 picture borders

Using the CSS3 border-image property, you can set...

Docker Compose network settings explained

Basic Concepts By default, Compose creates a netw...

How to use nginx to intercept specified URL requests through regular expressions

nginx server nginx is an excellent web server tha...