Using the generated private/public key pair: SFTP server side (UNIX)

  1. Ensure the SSH daemon service is enabled.
  2. Log in with hci user and create a new folder .ssh under the /home/hci/ folder.
    [hci@hvsheuer ~]$ mkdir .ssh     
  3. Change the permission of ~/.ssh, ~/.ssh/., ~/.ssh/.. to 700. That is, drwx------.
    [hci@hvsheuer ~]$ su
    Password:[root@hvsheuer hci]# chmod 700 /home/hci/.ssh
    [root@hvsheuer hci]# cd /home/hci/
    
    [root@hvsheuer hci]# chmod 700 /home/hci/.ssh/.
    [root@hvsheuer hci]# chmod 700 /home/hci/.ssh/..     
    [root@hvsheuer hci]# ls –al
    drwx------ 2 hci staff 4096 Mar 16 14:03 .ssh    
    [root@hvsheuer hci]# ls -al .ssh
    total 16
    drwx------ 2 hci staff 4096 Mar 16 14:03 .
    drwx------ 18 hci staff 4096 Mar 16 14:03 ..        
    
    [root@hvsheuer .ssh]# exit
    exit
    [hci@hvsheuer ~]$
  4. Create a new authorized_keys file under /home/hci/.ssh and copy the public key content to /home/hci/.ssh/authorized_keys.
    cat id_dsa.pub >> /home/hci/.ssh/authorized_keys
  5. Ensure the permission of file authorized_keys is -rw-r--r--.