I guess a lot of folks like me need to work on Windows with remote Linux boxes. This is an integrated solution to easy your daily jobs -- SSH login. The basic idea here is to share your rsa key-pair between different SSH clients.
Several Tools You Might Need:
Generating SSH2 Key-pair:
- Method A: simply issue ssh-keygen in MSYS shell
- Mehotd B: start PUTTYGEN.exe and click "Generate" button.
Method A is recommended because it creates Linux compatible key-pair files and stores the files to $(HOME)/.ssh. In case you don't use MSYS, please follow PuTTY manual for method B to complete SSH authentication with PUTTYGEN.
Setup PuTTY To Use SSH Authentication:
Import MSYS Keys Into PUTTYGEN:
- Conversions Menu > Import Key: import the "id_rsa" file under MSYS $HOME/.ssh
- Click "Save private key" button to save private key to a .ppk file (for PuTTY only)
- Click "Save public key" button to save a public key for PuTTY. (optional)
Config PuTTY:
- start a PuTTY instance (default session)
- browse to Connction > SSH > Auth > "Private key file for authentication"
- points to the .ppk file you just created in above step.
- browse to Session
- click "Default Settings"
- click "Save" button to save current config to your default settings.
Setup TotalCMD SFTP Plugin:
Create key files for SFTP plugin
- start puttygen.exe
- click "Load" buttong to load the .ppk file you created above
- Conversions Menu > Export OpenSSH Key: export a private key (.pem file) for Total Command SFTP plugin
- copy from "Public key for pasting into OpenSSH authorized_keys file"
- paste into a new file named "rsa.pub" (this file is actually same to rsa.pub under MSYS $HOME/.ssh)
Config TotalCMD SFTP Connection: TotalCMD help gives you more detail -- click the '?' button besides "Public key file".
- in TotalCMD, browse to Network Neighbor > Secure FTP
- press F7 to create new connection
- points to .pub file above for public key
- points to .pem file above for private key
Publish your public key to the remote server:
# simply issue below 2 lines of command in MSYS shell
# both of the commands need you to input the password
ssh <user>@<remote_host> mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh <user>@<remote_host> 'cat >> .ssh/authorized_keys'
# now you can forget the password, try this:
ssh <user>@<remote_host>
Check
this article for more information
分享到:
相关推荐
在 /etc/ssh/sshd_config 文件中,需要修改 Authentication 部分,注释掉“PermitRootLogin without-password”并添加“PermitRootLogin yes”: sudo vi /etc/ssh/sshd_config Authentication #PermitRootLogin ...
依次运行下面命令进行安装: 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 topic How to use SFTP (with client validation - password authentication) discusses the simplest form of client authentication, via password. In public key authentication, SSH clients and ...
找到`PermitRootLogin`行,可能注释掉了或者设置为`without-password`,将其改为`yes`,如下所示: ``` PermitRootLogin yes ``` 保存并关闭文件后,需要重启SSH服务以应用新的配置: ```bash sudo systemctl ...
例如,若要禁止root用户密码登录,可以注释掉`PermitRootLogin without-password`行,并添加`PermitRootLogin no`。 6. **连接SSH**: 使用SSH命令进行远程登录,格式为`ssh username@hostname`,其中`username`是...
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 ...
- Connect to the system using the SSH client: ```bash ssh username@ip_address ``` 3. **Key-Based Authentication:** - Generate SSH keys: ```bash ssh-keygen ``` - Copy the public key to the ...
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...
Hence, it becomes possible for the attacker to issue a command to all the nodes, that target a single node (for example, all nodes in the botnet might be commanded by the attacker to send a TCP SYN ...
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config service ssh restart sudo passwd root 这将启用 SSH root 登录,并提示输入新的 root 密码。 切换到 Root 用户 这是...
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