欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 美景 > Linux系统和数据库常用的命令2

Linux系统和数据库常用的命令2

2025/5/15 2:08:06 来源:https://blog.csdn.net/qq_61920297/article/details/142784054  浏览:    关键词:Linux系统和数据库常用的命令2

Linux系统和数据库常用的命令2

1、两台Linux机器ssh免密登录

client端登录server端需要免密,只需把公钥发送到server就可,会在server端生成一个authorized_keys文件

# 108机器上[root@client ~]# ssh-keygen -t rsa  // 非对称算法
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): //所保存的公钥文件地址
Enter passphrase (empty for no passphrase): 是否设置密码
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub私钥地址
The key fingerprint is:
SHA256:uRr7QU1LWwkkGvtBdLxLAxi3eAPCR3Sutm2nf0LGWXw root@client
The key's randomart image is:
+---[RSA 3072]----+
|   ..o*+*o+      |
|    ..o@.+.. .   |
|     .+ *.ooo    |
|       + B++o E  |
|      o So+= .   |
|     . + .*      |
|      o =o.      |
|       = +. .    |
|      o.o..o     |
+----[SHA256]-----+
[root@client ~]# ll .ssh/
total 12
-rw------- 1 root root 1679 Oct  9 12:40 id_rsa
-rw-r--r-- 1 root root  395 Oct  9 12:40 id_rsa.pub
-rw-r--r-- 1 root root 1225 Sep 19 15:37 known_hosts[root@client ~]# ssh-copy-id root@192.168.6.109[root@client ~]# ssh root@192.168.6.109公钥放在authorized_keys这个文件中了
[root@postgres .ssh]# ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts

2、git bash的常用操作

2.1、先去fork别人的仓库,直接新建就可以了

在这里插入图片描述

2.2、克隆自己的git仓库到本地

$ git clone https://github.com/.../pgdoc-cn.git

2.3、查看配置是否有问题

一般来说直接clone下来的仓库,参数配置一般是没有问题的

  1. 查看远程仓库信息

    git remote -v
    
  2. 查看全局配置(用户名)

    git config --global user.name
    
  3. 查看全局配置(邮箱)

    git config --global user.email
    
  4. 修改全局配置(用户名)

    git config --global user.name "w797847480"
    
  5. 修改全局配置(邮箱)

    git config --global user.email "aison.wang@....com"
    
  6. 生成 SSH 密钥

    ssh-keygen -t rsa -b 4096 -C "aison.wang@fexbase.com"
    
  7. 测试 SSH 连接

    ssh -T git@github.com
    
  8. 设置远程仓库 URL

    git remote set-url origin git@github.com:wkz2797848480/pgdoc-cn.git
    
  9. 克隆远程仓库

    git clone URL
    
  10. 进入目录

    cd directory
    
  11. 初始化 Git 仓库

    git init
    
  12. 添加文件到暂存区

    git add .
    
  13. 查看状态

    git status
    
  14. 提交更改

    git commit -m "update pg_dump.sgml"
    
  15. 添加远程仓库

    git remote add origin https://github.com/.../pgdoc-cn.git
    
  16. 推送到远程仓库

    git push -u origin master
    
  17. 查看分支

    git branch
    
  18. 切换分支

    git checkout <branch-name>
    

2.4、提交PR(pull rquest)

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词