1.ssh调试

ssh -vT username@ip[or hostname]

T表示测试,v显示详细信息

也可以配置config文件(在~/.ssh/config)指定用户名和密码

[gerrit2@pre-srv .ssh]$ vi config 
Host hostgitlab
Hostname gitlab.test.mycompany.com
User git
IdentityFile ~/.ssh/admin

2.指定私钥

如果公钥私钥不是默认名(id_rsa  id_rsa.pub), 在把公钥放置到远端服务器的authorized_keys中或者gitlab中,直接ssh连接是失败的,提示输入密码

但密码怎么输入都不对,这时要考虑是私钥没取对

需在config中指定  即IdentityFile ~/.ssh/admin

注意,此处是私钥,不是公钥

再测试,即成功

[gerrit2@pre-srv44 devwork]$ ssh -T hostgitlab
Welcome to GitLab, gerrit2!

ssh调试及指定私钥的更多相关文章

  1. ssh 配置文件讲解大全 ssh调试模式 sftp scp strace进行调试 特权分离

    ssh 配置文件讲解大全  ssh调试模式  sftp scp strace进行调试  特权分离 http://blog.chinaunix.net/uid-16728139-id-3265394.h ...

  2. shell使用lftp连接ftp和sftp,并可以指定私钥

    lftp连接ftp在脚本中可以 lftp -c "open username:password@host:port; ls /Friso/20180822/click/mobile/SUCC ...

  3. Visual Studio 2017 通过SSH 调试Linux 上.NET Core

    Visual Studio 2017 通过SSH 调试Linux 上.NET Core 应用程序. 本文环境 开发环境:Win10 x64 Visual Studio 2017 部署环境:Ubuntu ...

  4. git使用ssh协议,生成公钥和私钥,并指定私钥

    http://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use In ~/.ssh/config, add ...

  5. ssh 命令行通过私钥登录其它设备

    ssh -i root(私钥文件) root@IP (被访问的服务器IP) 这里备份一下了

  6. ssh 远程登陆指定端口

    ssh 到指定端口  ssh -p xx user@ip      xx 为 端口号    user为用户名   ip为要登陆的ip SSH 原理及远程登录 http://www.ruanyifeng ...

  7. ssh 远程登陆指定port

    ssh 到指定port  ssh -p xx user@ip      xx 为 port号    user为username   ip为要登陆的ip

  8. SSH,公钥,私钥的理解

    参考大佬的文章:https://blog.csdn.net/li528405176/article/details/82810342    https://www.cnblogs.com/Bravew ...

  9. SSH调试

    <s:date>标签中若是用date数组或Calendar数组,则永远显示数组最后一个数. 试试List.Set.Map也不行. 看来只能够使用单个对象.或者在后台传送String 数组, ...

随机推荐

  1. 百练-16年9月推免-C题-图像旋转

    C:图像旋转 查看 提交 统计 提问 总时间限制:  1000ms 内存限制:  65536kB 描述 输入一个n行m列的黑白图像,将它顺时针旋转90度后输出. 输入 第一行包含两个整数n和m,表示图 ...

  2. 利用selenium模拟登录webqq

    from selenium import webdriver import selenium.webdriver.support.ui as ui import time opt = webdrive ...

  3. [LeetCode&Python] Problem 447. Number of Boomerangs

    Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of po ...

  4. 【转】【计算机视觉】opencv靶标相机姿态解算2 根据四个特征点估计相机姿态 及 实时位姿估计与三维重建相机姿态

    https://blog.csdn.net/kyjl888/article/details/71305149

  5. xdoj 1330---异或(找规律)

    我是打表找的规律 233 样例什么作用都没有 只会迷惑作用... 1330: 天才琪露诺的完美算数教室 时间限制: 1 Sec  内存限制: 128 MB  Special Judge提交: 37   ...

  6. powerdesigner基本使用

    parent sonPK主键 FK外键 n ------> 1 alter table muniubox.cpa_accounting_book add constraint FK_Refere ...

  7. Echarts全解注释

    coordinate-geo.js文件为地理坐标系的配置参数 mytextStyle={ color:"#333",//文字颜色 fontStyle:"normal&qu ...

  8. 【BZOJ2820】ygy的gcd

    不知道为什么不想写总结,只是(因为是用别人的权限号交的所以)屯一个代码 #include<iostream> #include<cstdio> #include<algo ...

  9. Unity3D用户手册 学习

  10. Java 11 部分新特性

    JEP 320: Remove the Java EE and CORBA Modules(删除 Java EE 和 CORBA 模块) Java EE和CORBA两个模块在JDK9中已经标记&quo ...