Step 1 of 2 : On local machine: Generate Authentication Keys
Authentication keys are a pair of private and public keys. Your
public key is also a 2-3 lines long gibberish word. The public key is
like your login and becomes your identity. Your private key are like
your password, but much longer that a regular password. You can
generate your public and private keys by typing the following command:
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/vineetmanohar/.ssh/id_rsa):
Accept the default choice. Hit enter
.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Hit enter twice
. A passphrase encrypts your private
key so that no one can see it. However, you cannot encrypt your private
key if you want a password-less login.
The key fingerprint is:
5e:26:52:34:a1:22:18:68:11:11:7d:8d:c6:d5:4b:bf vineetmanohar@vineetmanohr.com
What just happened?
On your local server you just created 2 files in your ~/.ssh directory.
cd ~/.ssh
ls -l
-rw------- 1 vineetmanohar vineetmanohar 1675 2009-07-17 17:27 id_rsa
-rw-r--r-- 1 vineetmanohar vineetmanohar 411 2009-07-17 17:27 id_rsa.pub
id_rsa
contains your private key. id_rsa.pub
contains your public key.
Step 2 of 2 : On remote machine: authorize password less login
Login to remote machine
ssh hostname -l username
The authenticity of host 'vineetmanohar.com (XXX.XXX.XXX.XX)' can't be established.
RSA key fingerprint is 44.2b:93:ce:1b:1b:99:3a:6d:91:d1:50:aa:0d:87:40.
Are you sure you want to continue connecting (yes/no)?
Type yes
and hit enter.
Warning: Permanently added 'vineetmanohar.com,XXX.XXX.XXX.XX' (RSA) to the list of known hosts.
username@vineetmanohar.com's password:
Enter your password, and hit enter.
Create a .ssh directory on the remote machine and create a
.authorized_keys file in that directory. You need to copy the entire
contents of your local machine’s ‘id_rsa.pub’ and paste it in the
.authorized_keys file on the remote server.
-
mkdir .ssh
-
chmod 700 .ssh
-
cd .ssh
-
touch authorized_keys
-
chmod 600 authorized_keys
-
vi authorized_keys
-
# copy-paste the entire contents of your local machine's ~/.ssh/id_rsa.pub file in authorized_keys
-
# logout
-
exit
mkdir .ssh
chmod 700 .ssh
cd .ssh
touch authorized_keys
chmod 600 authorized_keys
vi authorized_keys
# copy-paste the entire contents of your local machine's ~/.ssh/id_rsa.pub file in authorized_keys
# logout
exit
You should now be able to login to the remote server without typing your password.
-
# type this command from your local machine
-
ssh hostname -l username
# type this command from your local machine
ssh hostname -l username
SSH should log you in without password! Now, you can also scp or rsync (over ssh) without having to enter your password.
分享到:
相关推荐
MacLinux无密码ssh客户端,一键登录远程服务器。一个SSH远程客户端,可一键登录远程服务器.zip
4.输入密码(注意在输入密码时没有*提示),就完成了。 方法二:使用iTerm2 1.打开iTerm2并输入命令:cd ~/.ssh/ 2.创建一个文件:vim + 文件名 3.在文件中输入一下内容,并保存退出。 #!/usr/bin/expect -f set ...
"通过SSH访问远程Linux服务器的四个安全策略" 在远程访问Linux服务器时,安全性是一个非常重要的方面。下面四个安全策略可以帮助您更好地...同时,使用强密码、限制 IP 登录和使用证书登录也可以提高服务器的安全性。
widnows自动登录ssh服务器自动执行命令的脚本
go写的一个ssh远程客户端。可一键登录远程服务器,主要用来弥补Mac Terminal ssh无法保存密码的不足
可是在终端使用ssh我们每次都需要输入账号和密码,这也是一个烦恼,所以我们可以简单的打造一个在Linux/Mac os运行的自动ssh登录远程服务器的小工具。 来个GIF动画示例下先: 概述 我们先理一下我们需要些什么...
Linux 是一个流行的开源操作系统, SSH(Secure Shell)是 Linux 中的一种安全协议,允许用户远程登录到 Linux 服务器并执行命令。设置 SSH 无密码登录可以提高 Linux 服务器的安全性和便捷性。在本文中,我们将...
这是一个可以自定义参数的使用Ssh2连接远程服务器的连接池,比如目标服务器地址、名称和密码;自定义连接池参;还提供了两个工具类,来向目标服务器的指定路径下上传文件或下载文件
下载paramiko 首先,我的windows系统上有python2和python3。使用下面命令切换到python3: activate py3 接着使用下面命令下载相关模块: pip install ecdsa pip install Crypto ...ssh = paramiko.SSHClient
Windows 远程 SSH 连接 Linux 服务器(Xmanager 说明书) 本文档介绍了使用 Xmanager 在 Windows 平台下远程连接 Linux 服务器的方法,包括 shell 连接、图形界面连接和 ssh 文件传输连接。下面是详细的知识点解释...
Linux环境通过shell脚本进行ssh登录服务器 里面包好ssh登录的用法以及interact交互 以及通过echo覆盖文件或者重定向文本,输入ssh远程服务器的密码,账户完全自动输入账号,密码登录服务器
在 A 主机终端输入 ssh username@192.168.3.102 登录到 192.168.3.102 这个 SSH 服务器,然后会让你输入密码,之后就登录了。 四、X 界面转发 如果想要显示图形界面,需要做一些配置。首先,服务器端的 SSH 必须...
其中包含sshpass-1.06,sshpass-1.08,sshpass-1.09以及sshpass1.10版本
Xshell-7是一款功能强大的SSH远程终端工具,它允许用户通过SSH协议安全地连接到远程服务器,并进行远程管理和操作。该工具在业界享有很高的声誉,被广大用户誉为SSH工具中最经典、最好用的之一。 Xshell-7提供了...
支持RDP,SSH远程,Radmin。账号密码记录。支持服务器远程同时管理后台账号密码。 支持到期 钉钉机器人通知。右下角窗口提醒。 图标:正常:绿图标,到期:红图标,离线(PING不通):黑图标 后台账号密码说明:...
今天小编就为大家分享一篇关于Mac通过不同终端SSH连接远程服务器的讲解,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
3、然后输入在服务器上的用户密码回车 4、到此进入的是你在服务器上的账户的目录,即为连接成功 最后输入sudo su -进入服务器的根目录,进行操作 连接设置别名 使用vi命令编辑一下~/.ssh/config这个文件(如果目录...
使用vbs脚本实现ssh一键连接服务器
使用 SSH 客户端工具实现密钥登录 Linux 服务器 SSH(Secure Shell)是一种安全的网络协议,用于加密远程连接和身份验证。今天,我们将讨论如何使用 SSH 客户端工具实现密钥登录 Linux 服务器。 为什么需要密钥...