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. Spring注解驱动开发之AOP

    前言:现今SpringBoot.SpringCloud技术非常火热,作为Spring之上的框架,他们大量使用到了Spring的一些底层注解.原理,比如@Conditional.@Import.@Ena ...

  2. 简说JAVA8引入函数式的问题

    JAVA8中加入lambda演算是一个令人兴奋的新特性——虽然这个新特性来得太迟了,目前的主流开发语言中,JAVA似乎是最后一个支持函数式思维的语言. 虽然晚了点,但总比没有好——况且我认为它的实现还 ...

  3. 企业面试之LeetCode刷题心得

    谈起刷LeetCode的心得,想要先扯点别的,说实话我是比较自虐的人,大学时候本专业从来不好好上,一直觊觎着别人的专业,因为自己文科生,总觉得没有项技术在身出门找工作都没有底气,然后看什么炫学什么,简 ...

  4. 浅谈2015新版 U-Boot

    过了挺长一断时间没有看U-BOOT了,这两天下载了新版的UBOOT源码(之前看的一些书都是基于早好多年的源码来讲述,总感觉心里有点不对劲,也许是我比较喜新的原因吧,不过小弟我并没有厌旧哈),好了不多扯 ...

  5. (转)淘淘商城系列——SSM框架整合之表现层整合

    http://blog.csdn.net/yerenyuan_pku/article/details/72721120 上文我们一起学习了Service层的整合,本文将教大家如何整合表现层. 我们在t ...

  6. ubuntu18.04 python版本切换

    update-alternatives是ubuntu系统中专门维护系统命令链接符的工具,通过它可以很方便的设置系统默认使用哪个命令.哪个软件版本,比如,我们在系统中同时安装了python2.7和pyt ...

  7. WPF学习- AllowDrop 用户控件启用拖放功能

    知识点: 创建自定义用户控件(UserControl) 使用户控件成为拖动源 使用户控件成为放置目标 使面板能够接收从用户控件放置的数据 创建项目: 1.新建WPF项目(Wpf-AllowDrop) ...

  8. DataRow复制一行到另一个DataTable

    DataRow复制一行到另一个DataTable   下面两个方法是DataRow复制一行到另一个DataTable的,直接Add会出错“此行已属于另一个表”,其实以前就知道怎么做的,可每次要用到的时 ...

  9. jquery.form.min.js

    /*! * jQuery Form Plugin * version: 3.51.0-2014.06.20 * Requires jQuery v1.5 or later * Copyright (c ...

  10. 【2019 1月集训 Day1】回文的后缀

    题意: 给定 n,s,求有多少个字符集大小为 s ,长度为 n 的字符串,使得其不存在一个长度大于 1 的回文后缀. 答案对 m 取模. 分析: 考场见到计数题的链式反应,想写暴力—>暴力难写— ...