sftp auto login/authorized_keys Putty etc

XXXX@XXXX:~/.ssh$ ls -l
total 12
-rw------- 1 lake sys 3243 Apr  4 17:05 id_rsa             
-rw-r--r-- 1 lake sys  743 Apr  4 17:05 id_rsa.pub        
-rw-r--r-- 1 lake sys 1332 Aug 21 01:45 known_hosts
XXX@XXXX:~/.ssh$  cat id_rsa.pub >>authorized_keys
XX@XXXX:~/.ssh$ ls -l
total 16
-rw-r--r-- 1 lake sys  743 Sep 30 23:52 authorized_keys
-rw------- 1 lake sys 3243 Apr  4 17:05 id_rsa
-rw-r--r-- 1 lake sys  743 Apr  4 17:05 id_rsa.pub
-rw-r--r-- 1 lake sys 1332 Aug 21 01:45 known_hosts
XXXX@XXX:~/.ssh$

#$$$ file permission for SSH 

$ chmod 700  ~/.ssh
$ chmod 600  ~/.ssh/authorized_keys
$ chmod 600  ~/.ssh/id_rsa

 

Note:

id_rsa/pub should be gemerated without  Passphrase

Example from http://www.linuxproblem.org/art_9.html

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

###Windows  sftp -------->  Linux  

XXXXX@XXXXX MINGW64 ~ /Windows  

$ sftp -oIdentityFile=~/.ssh/id_rsa  yourname@RemoteLinuxIPAddress:test.txt
Connected to 10.106.23.224.
Fetching /home/XXXX/test.txt to test.txt
/home/XXXX/test.txt                          100% 1714   172.8KB/s   00:00

###Windows  putty -------->  Linux  

puttygen  ------ id_rsa ----> putty/pbk file(private key) 

Putty--->  Connection-->data -->  Auto-login username 
            Auth --->  Private key file/PPK load 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值