ssh root@192.168.124.128

密钥登录:
1)、ssh-keygen 生成公钥和私钥
[root@rhel5 ~]# 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:
4c:f2:c4:14:67:15:ef:5e:1e:43:44:94:45:ae:1a:cf root@rhel5

第二次生成
[root@rhel5 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
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:
9b:10:05:52:3e:67:a9:30:cd:84:28:36:85:c1:d6:0f root@rhel5

2)、把客户端公钥(id_rsa.pub)传给服务器:
[root@rhel5 .ssh]# ssh-copy-id -i id_rsa.pub 192.168.124.129
10
root@192.168.124.129's password:
Permission denied, please try again.
root@192.168.124.129's password:
Now try logging into the machine, with "ssh '192.168.124.129'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

公钥在服务器上的位置
[root@localhost .ssh]# ll
total 8
-rw------- 1 root root 392 Jun 20 23:47 authorized_keys //公钥被改名为authorized_keys,以后服务器就用它加密传输数据给客户端,客户端使用私钥--钥匙来做验证 能解开 ---->验证通过 解不开 ---->不是合法用户
-rw-r--r-- 1 root root 794 Jun 20 22:43 known_hosts

3)、无密码登录、无密码数据传输:
[root@rhel5 .ssh]#
[root@rhel5 .ssh]# ssh root@192.168.124.129
Last login: Wed Jun 20 22:44:09 2012 from 192.168.124.129
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#

实现无密码往回拽数据:
[root@rhel5 ~]# rm -rf log.tar.gz
[root@rhel5 ~]# rsync root@192.168.124.129:/tmp/log.tar.gz ./
[root@rhel5 ~]# ll
total 96
-rw------- 1 root root 1427 Jun 18 09:53 anaconda-ks.cfg
-rw-r--r-- 1 root root 26586 Jun 18 09:52 install.log
-rw-r--r-- 1 root root 3671 Jun 18 09:50 install.log.syslog
-rw-r--r-- 1 root root 9188 Jun 21 14:40 log.tar.gz
-rw-r--r-- 1 root root 26586 Jun 21 13:47 root@192.168.124.129
------------------------------------------------------------------

[root@rhel5 ~]# rm -rf log.tar.gz
[root@rhel5 ~]# scp root@192.168.124.129:/tmp/log.tar.gz ./
log.tar.gz 100% 9188 9.0KB/s 00:00
[root@rhel5 ~]# ll
total 96
-rw------- 1 root root 1427 Jun 18 09:53 anaconda-ks.cfg
-rw-r--r-- 1 root root 26586 Jun 18 09:52 install.log
-rw-r--r-- 1 root root 3671 Jun 18 09:50 install.log.syslog
-rw-r--r-- 1 root root 9188 Jun 21 14:38 log.tar.gz
-rw-r--r-- 1 root root 26586 Jun 21 13:47 root@192.168.124.129

口令登录:输入密码登录

远程传输是建立在远程登录之后的,登录一次---建立连接之后 开始传输数据
网上银行下载的证书:就是公钥---锁

ssh远程登录的更多相关文章

  1. 【浅层优化实战】ssh远程登录Linux卡慢的全过程排查及解决方案

    ssh远程登录Linux卡慢的全过程排查及解决方案 前言: 在linux操作系统使用过程中偶然一次感到使用ssh远程连接软件连接操作系统需要等待许久,第一次没在意,第二次也没在意,第三次有点忍受不住了 ...

  2. Firefly安装ROS及ssh远程登录配置

    一.在Linux firefly 3.10.0 上安装ROS-indigo 快捷键 CTRL + ALT  + T 打开终端并安装ROS-indigo sudo sh -c 'echo "d ...

  3. SSH客户端(如PuTTY)ssh远程登录Linux非常慢的解决方法

    转:http://blog.useasp.net/archive/2014/05/19/solved-the-problem-of-ssh-client-such-as-putty-remote-lo ...

  4. ssh远程登录linux live系统

    要想ssh远程登录,须要准备两件事:配置同网段IP和开启SSH服务. 因为live系统没有IP,所以首先须要配置IP. 我的live系统是在虚拟机上启动的,宿主IP为192.168.230.1,liv ...

  5. ssh远程登录linux服务器

    ssh远程登录linux服务器 用法: ssh -l user -p port server_ip 或者 ssh -p port user@server_ip 参数: -l 后接要登录的远程系统用户名 ...

  6. ssh远程登录命令简单实例

    ssh远程登录命令简单实例 ssh命令用于远程登录上Linux主机. 常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查 ...

  7. python实现ssh远程登录

    python实现ssh远程登录 # 测试过程中,比较常用的操作就是将DUT(待测物)接入网络中,然后远程操控对DUT, # 使用SSH远程登陆到主机,然后执行相应的command即可 # python ...

  8. SSH(远程登录)原理

    最近在研究hadoop,因为是分布式的,会涉及很多机器协作工作,但所有的操作都是需要进行权限验证的,namenode主机会尝试启动datanode主机上的进程等等.下面就用一张图来解释SSH登录验证的 ...

  9. ubuntu拒绝root用户ssh远程登录解决办法

    ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录,解决办法就是:修改ssh配置,然后重启ssh服务即可. vi /etc/ssh/sshd_config 找到并用#注 ...

  10. 使用Dockerfile文件制作centos6.8基础镜像,基于centos基础镜像的ssh远程登录镜像,jdk1.8镜像,tomcat镜像,elasticsearch镜像等等

    一.首先制作一个centos6.8的裸机镜像 创建一个干净的目录: [root@docker centos6.]# ls c68-docker.tar.xz Dockerfile Dockerfile ...

随机推荐

  1. ambari-server启动WARN qtp-ambari-client-87] ServletHandler: 563 /api/v1/stacks/HDP/versions/2.4/recommendations java.lang.NullPointerException报错解决办法(图文详解)

      问题详情 来源是,我在Ambari集群里,安装Hue. 给Ambari集群里安装可视化分析利器工具Hue步骤(图文详解 所遇到的这个问题. 然后,去ambari-server的log日志,查看,如 ...

  2. poj2573Bridge(过桥问题)

    链接 A,B为最快和次快 有两种方式可以使c,d过桥 一是a与c一起走,a回来接d再与d一起走,一直到对岸人为0为止 而是 a与b一起走 a回来送灯 c与d一起走 b回来送灯 重复此过程. 只剩2人时 ...

  3. R in action读书笔记(21)第十六章 高级图形进阶(上)

    16.1 R 中的四种图形系统 基础图形函数可自动调用,而grid和lattice函数的调用必须要加载相应的包(如library(lattice)).要调用ggplot2函数需下载并安装该包(inst ...

  4. 关于docker入门教程

    简介:docker入门教程 docker入门教程翻译自docker官方网站的Docker getting started 教程,官方网站:https://docs.docker.com/linux/s ...

  5. leetcode_486. Predict the Winner

    https://leetcode.com/problems/predict-the-winner/ 题目描述:给定一个非负的积分数组,玩家1可以从数组两端任取一个积分,接着玩家2执行同样的操作,直至积 ...

  6. PHP 之pthreads多线程模块在windows下的安装

    一.查看phpinfo 二.下载pthreads扩展 下载地址:http://windows.php.net/downloads/pecl/releases/pthreads/ 三.复制文件 复制ph ...

  7. vs2019装了WDK后,编译其他vc工程,提示无法打开文件"msvcprtd.lib"

    今天安装了vs2019,而后又安装了wdk,随便写了一个控制台测试程序,居然报错.网上也查了一圈,也没有得到解决.报错内容如下: MSB8038:已启用Spectre缓解,但找不到Spectre缓解库 ...

  8. Getting start with dbus in systemd (02) - How to create a private dbus-daemon

    Getting start with dbus in systemd (02) 创建一个私有的dbus-daemon (session) 环境 这里我们会有两个app: app1(client),ap ...

  9. 使用HTML5+调用手机摄像头和相册

    前言:前端时间使用HTML5做了一个WEB端APP,其中用到了H5页面调用手机摄像头的功能,当时也是花了不少时间去研究.最终是采用了HTML5plus(HTML5+)的方式完成了该功能,现将具体方法简 ...

  10. MFC定时器的使用

    巧妙地使用定时器能达到意想不到的效果,写界面的时候能实现渐变,也能帮助多线程控制等我们知道,在VC的MFC中,已经为我们封装好了很多全面和强大的函数集,所以在MFC编程时,巧妙地调用MFC函数库可以为 ...