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