原文地址:http://manjeetdahiya.com/2011/03/03/passwordless-ssh-login/

Consider two machines A and B. We want to connect machine B from A over SSH. To do so we have to specify password every time we connect. Here, we can create a setup where SSHing can be done without the password prompt.  On connecting machine B from A, ssh won’t ask for password.

Overview of Setup

  • Generate public and private encryption keys on machine A.
  • Authorize machine A in machine B by appending the public key of A in the file authorized_keysof machine B.

That’s it! You can now access (SSH) machine B from A without specifying the password. B has been now authorized to access A without requiring the password.

Detailed Steps

Method 1

  • Login to machine A and execute the following command:

    ?
    1
    ssh-keygen && ssh-copy-id -i user@B

    The first command generates keys. It will ask for path of the keys and passphrase. Hit Enter key repeatedly to choose the default values.
    The second command adds generated key to B. It will ask for password of user at machine B. And this would be the last time!

Method 2

  • Login to machine A.
  • Generate public and private keys like following:
    ?
    1
    ssh-keygen -t dsa

    It will ask for path of the keys and passphrase. Choose the default path and no password.
    This will generate files id_dsa.pub and id_dsa in ~/.ssh

  • Browse for the above generated keys and copy the public key, that is id_dsa.pub, to the machine B.
  • Login to machine B.
  • Append the public key of A to the file authorized_keys:
    ?
    1
    cat id_dsa.pub >> .ssh/authorized_keys

    Note: Create the directory .ssh in your home if it doesn’t exist.
    You can now delete id_dsa.pub from machine B if you want to.

  • Make sure of the permissions of the directory .ssh and the file authorized_keys are read-write only by the targetted user. Otherwise it might not work.
    ?
    1
    2
    chmod 700 .ssh
    chmod 600 .ssh/authorized_keys

  • Now go back to machine A and SSH machine B. It should not ask for the password.

Passwordless SSH Login相关推荐

  1. How To Fix: SCP And SSH Login Prompt Is Very Sl...

    2019独角兽企业重金招聘Python工程师标准>>> For my case, the GSSAPI authentication feature was causing the ...

  2. Cisco Equipment Configuration SSH login

    Cisco's products currently only support SSH-1, does not support SSH-2, IOS support SSH features Vers ...

  3. 解决:“[INS-06006] Passwordless SSH connectivity not set up” 报错

    在安装完RAC时,在安装Oracle,rac1与rac2互信时,遇到[INS-06006] Passwordless SSH connectivity not set up between the f ...

  4. [INS-06006] Passwordless SSH connectivity not set up between the following node(s)

    问题描述:[INS-06006] Passwordless SSH connectivity not set up between the following node(s): [fgedu1, fg ...

  5. How to speed my too-slow ssh login?

    http://unix.stackexchange.com/questions/5621/how-to-speed-my-too-slow-ssh-login Edit your "/etc ...

  6. ssh无密码登录_3个简单步骤即可完成无密码SSH登录

    ssh无密码登录 SSH (Secure SHELL) is a secure opensource network protocol that allows users to log in secu ...

  7. git ssh 代理_Git通过SSH隧道作为代理

    git ssh 代理 git is a great tool and it is common to have a git server over SSH possibly managed by gi ...

  8. ubuntu backup-manager 高效备份工具

    无论简单与否,我们都有机会去了解这么一件事,那就是备份的重要性从来都不可以被低估.考虑到备份的方法真的多如牛毛,你可能想要知道怎样来有效地为你的系统选择正确的工具和和合适的策略. 在本文中,我将为你介 ...

  9. HBase部署之官网翻译

    Quick Start - Standalone HBase This section describes the setup of a single-node standalone HBase. A ...

最新文章

  1. VC实用小知识总结 (一),转http://blog.csdn.net/myiszjf/article/details/10007431
  2. ZooKeeper的事务日志和快照
  3. php 命名空间地址,php命名空间简介
  4. android引用的java包_Android开发中jar包的创建及引用
  5. float 精度_float相加产生精度损失的原因是什么?
  6. Vue中使用Openlayers加载Geoserver发布的TileWMS
  7. boost::hof::rotate用法的测试程序
  8. 数百个 HTML5 例子学习 HT 图形组件 – 拓扑图篇
  9. 数学--数论--HDU1825(积性函数性质+和函数公式+快速模幂+非互质求逆元)
  10. 物联网安防技术融合在细分领域的应用分析
  11. Jquey将序列化对象在前台显示地几种方式
  12. RTOS原理与实现10:互斥信号量实现
  13. 电脑不会当局者迷——评人机围棋大战
  14. 一功能简单的BBS系统源代码
  15. 用Java输出正方形,长方形
  16. Elasticsearch安装拼音分词器插件
  17. pixi.js淘宝小程序快速上手指南
  18. 支持自动查找和选择的ComboBox的具体实现
  19. 古学今用——不要那么直白了
  20. Gson格式化LocalDateTime

热门文章

  1. ·XP注册表修改大全
  2. css3 仿aero,让Qt支持Win7的Aero和毛玻璃效果
  3. 去掉圆角_小米11高清渲染图曝光:蓝色机身 圆角矩形摄像模组
  4. MySQL高级 - SQL优化 - limit优化
  5. 重量级锁的加锁的基本流程
  6. 为什么需要动态SQL?
  7. 百万数据报表读取:步骤分析以及自定义事件处理器
  8. 重载练习1_四种不同参数类型的方法
  9. plsql(轻量版)_异常处理机制
  10. 高级concurrent包