Enable password login instead of using SSH Keys | Thorn Technologies

Enable password login instead of using SSH Keys

Note! To enable password authentication in SFTP Gateway version 2.0, please see SFTP Gateway 2.0 Enable password login instead of using SSH keys

Although we don't recommend it because it is less secure, there are times when you might want to enable password logins for a particular user. This can be done by doing the following from the command line on your SFTP Gateway instance:

  1. If you haven't already done so, run the sudo addsftpuser <user> command. Select 'N' and then press enter when prompted to create a new key.

  2. Manually set the users password using the 'passwd' command like so

     $ sudo passwd bob
     Changing password for user bob.
     New password:
     Retype new password:
     passwd: all authentication tokens updated successfully.
  3. Modify the SSH server settings by typing sudo nano /etc/ssh/sshd_config

  4. Add the following text at the very end of the file

    Match User bob
    PasswordAuthentication yes
  5. On line 86, change ChallengeResponseAuthentication to yes

    # Change to no to disable s/key passwords
    ChallengeResponseAuthentication yes
    #ChallengeResponseAuthentication no
  6. Save the sshd_config file with ctrl-o, it will display a bar at the bottom of the screen that says "File Name to Write: ", press the enter key

  7. Exit nano with ctrl-x

  8. Restart SSH by typing sudo service sshd restart

  9. User "bob" should now be able to sftp using a password

    $ sftp bob@52.202.XXX.XXX
    bob@52.202.XXX.XXX's password:
    Connected to 52.202.XXX.XXX.
    sftp> pwd
    Remote working directory: /home/bob
    sftp> bye