1,基本环境
系统版本
[centospub@davidserver ~]$ cat /etc/issue;uname -a
CentOS release 6.3 (Final)
Kernel \r on an \m
Linux davidserver 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
用户
centospub:x:502:502::/home/centospub:/bin/bash
密码
centospub
管理机
10.0.0.9
被管理机
10.0.0.10
2,管理机生成公钥和密钥
[centospub@davidserver ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/centospub/.ssh/id_dsa):
Created directory '/home/centospub/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/centospub/.ssh/id_dsa.
Your public key has been saved in /home/centospub/.ssh/id_dsa.pub.
The key fingerprint is:
19:e8:fd:c8:01:32:da:a3:18:de:7e:83:c4:2d:f2:7f centospub@davidserver
文件修改
[centospub@davidserver ~]$ cd .ssh/
[centospub@davidserver .ssh]$ ls
id_rsa.pub id_rsa
[centospub@davidserver .ssh]$ mv id_rsa.pub authorized_keys
[centospub@davidserver .ssh]$ chmod 400 authorized_keys
3,将公钥传到被管理机
[centospub@davidserver .ssh]$ scp authorized_keys centospub@10.0.0.10:/home/centospub/.ssh
The authenticity of host '10.0.0.10 (10.0.0.10)' can't be established.
RSA key fingerprint is 6e:49:32:73:8d:40:4e:f2:ee:dc:48:fb:3e:37:a3:b8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.10' (RSA) to the list of known hosts.
shuqing@10.0.0.10's password:
id_dsa.pub 100% 602 0.16KB/s 00:00
4,管理机通过公钥连被管理机
[centospub@davidserver ]$ ssh centospub@10.0.0.10
指定私钥
[centospub@davidserver ]$ ssh centospub@10.0.0.10 -i .ssh/id_dsa.it.20120915
分享到:
相关推荐
Linux操作系统与实训(CentOS 7.4 & RHEL7.4)(微课视频版)ppt及答案.rar
centos用户&组权限&添加删除用户总结
CentOS 5&6&7服务器repo文件
CentOS6.6&L219;英特尔网卡驱动编译适用于centos配合新款台式机
1、支持centos6(在JDK1.7下编译)和centos7(在JDK1.8下编译)。 2、里面的jar包括: ffmpeg-3.0.2-1.2.jar ffmpeg-3.0.2-1.2-linux-x86_64.jar opencv-3.1.0-1.2.jar opencv-3.1.0-1.2-linux-x86_64.jar javacpp-...
centos系统&YMS;系统环境安装与搭建V1.0,centos系统&YMS;系统环境安装与搭建V1.0
配置无密钥登陆
亲测可用,欢迎大家免费下载,很好的资源,centos,gcc,libmpc,glibc-headers,libstdc++-devel
kmod-oracleasm-2.0.8-28.el7.x86_64.rpm oracleasmlib-2.0.12-1.el7.x86_64.rpm oracleasm-support-2.1.8-3.el7.x86_64.rpm
服务器应用,提供了如何安装Centos7.9.2009和如何配置网络; C/C++的在线安装和在线转源为阿里云
CIS OS层的基线检查 阿里云的基线检查就依据CIS的基线检查 英文的 需要语言功底
14.1 接触CentOS 8 14.2 升级到CentOS 8 14.3 接触CentOS Stream 14.4 升级到CentOS Stream 14.5 CentOS Stream新功能
通过这份源码,也许不能让你彻底明白RSA原理,但是足可以让你彻底学会如何使用RSA。 精品源码,你值得拥有! 源文件列表如下: bignum.cpp, bignum.h bn_mul.h md.cpp, md.h md_wrap.cpp, md_wrap.h md2.cpp, ...
Linux & CentOs & Mysql & Xshell & FileZilla
openssh8.8p1-rpm安装包-centos7/rhel7已测试通过,附带安装方法
安装单机环境
DELL R750/740服务器H750/H755 raid卡 安装CentOS/RHEL7.4/7.5/7.6/7.7操作系统
centos中GIT服务器搭建及使用密钥连接.pdf
用于离线安装nginx或者需要需要gcc或者g++安装其他应用