The following steps can be used to ssh from one system to
another without specifying a password.
Notes:
- The system from which the ssh session is started via the
ssh command is the client
.
- The system that the ssh session connects to is the
server
.
- These steps seem to work on systems running OpenSSH
.
- The steps assume that a DSA key is being used. To use a RSA
key substitute 'rsa' for 'dsa'.
- The steps assume that you are using a Bourne-like shell
(sh, ksh
or bash
)
- Some of this information came from:
http://www.der-keiler.de/Mailing-Lists/securityfocus/Secure_Shell/2002-12/0083.html
Steps:
-
On the client
run the following
commands:
$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''
This should result in two files, $HOME/.ssh/id_dsa (private
key) and $HOME/.ssh/id_dsa.pub (public key).
-
Copy $HOME/.ssh/id_dsa.pub to the
server
.
-
On the server
run the following
commands:
$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2
Depending on the version of OpenSSH the following commands
may also be required:
$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys
$ chmod 0600 $HOME/.ssh/authorized_keys
An alternative is to create a link from authorized_keys2 to
authorized_keys:
$ cd $HOME/.ssh && ln -s authorized_keys2 authorized_keys
-
On the client
test the results by ssh'ing to
the server
:
$ ssh server
-
(Optional) Add the following $HOME/.ssh/config on the
client
:
Host server
IdentityFile ~/.ssh/id_dsa
This allows ssh access to the server
without
having to specify the path to the id_dsa file as an argument to ssh
each time.
分享到:
相关推荐
依次运行下面命令进行安装: sudo dpkg -i openssh-client_1%3a7.6p1-4ubuntu0.6_amd64.deb sudo dpkg -i ncurses-term_6.1-1ubuntu1.18.04_all.deb ... 删除permitRootLogin后面的without-password后改为yes
#此步骤主要目的是修改sshd_config配置文件,把配置文件中的”PermitRootLogin without-password”加一个”#”号,把它注释掉,再增加一句”PermitRootLogin yes”,参考:https://www.jianshu.com/p/adda91b7c1d2 ...
The recommended minimum size of a disk image is 1024 MB (with LXDE), and without a GUI - 512 MB. When you install Linux on the flash card with the FAT32 file system, the image size should not exceed ...
prohibit-password/without-password that could, depending on compile-time configuration, permit password authentication to root while preventing other forms of authentication. This problem was ...
You can optionally enter your key's passphrase (which is advisable – otherwise the converted key will be saved without a passphrase, which is insecure). Then via Conversions -> Export OpenSSH ...
此工具必须在主服务器上运行ssh 访问两台服务器(主从) 使用 ssh 从主服务器到从属服务器的 ssh 访问(谷歌:ssh without password) 在这一点上有一些帮助。 使用 ssh 以您要使用的帐户名登录到您的服务器。 提示...
PermitRootLogin without-password 改为 PermitRootLogin yes 重启ssh服务:sudo service sshd restart 密码设置:sudo passwd user-name 然后设置各个主机的映射 sudo vim /etc/hosts 192.168.128.128 Master 192....
Table of Contents Preface 1 Chapter 1: Shell Something Out 7 Introduction 7 Printing in the terminal 9 ...Password-less auto-login with SSH 253 Running commands on remote host with SSH 255
A project model for the FreeBSD Project Niklas Saers Copyright © 2002-2005 Niklas Saers [ Split HTML / Single HTML ] Table of Contents Foreword 1 Overview 2 Definitions 2.1. Activity 2.2. Process ...
Access Windows Shares Without a Server Section 20. Deal with Disk Hogs Section 21. Manage Temporary Files and Swap Space Section 22. Recreate a Directory Structure Using mtree Section...
Computer Networking: A Top-Down Approach, 6th Edition Solutions to Review Questions and Problems Version Date: May 2012 This document contains the solutions to review questions and problems...
A tutorial for UltraEdit/UEStudio's SSH/telent feature Adding a wordfile Adding a wordfile in UltraEdit v15.00 and greater Adding a wordfile (in v14.20 and earlier) Add a language definition to your ...
Using HTTPLoris is simple. In its most basic form, HTTPLoris merely needs a copy of Python 2.6. ...Optionally, one may set a username and password for the SOCKS proxy using these two flags.
本文为大家分享了Ubuntu server版安装图文教程,供大家参考,具体内容如下 ...找到PermitRootLogin without-password一行,改为PermitRootLogin yes 6. 重启 openssh server $ sudo service ssh restart 7. xshe