Logo

How can we help?

Get answers to your questions right here...

Enable password login instead of using SSH Keys

SFTP Gateway

Enable password login instead of using SSH Keys

Last updated on 11 Apr, 2019

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

      <span class="err">
    • b8af8232-d344-4486-a4dd-5490c5d08feb

    • lt;/span> <span class="n">sftp</span> <span class="n">bob</span><span class="mf">@52.202</span><span class="p">.</span><span class="n">XXX</span><span class="p">.</span><span class="n">XXX</span> <span class="n">bob</span><span class="mf">@52.202</span><span class="p">.</span><span class="n">XXX</span><span class="p">.</span><span class="n">XXX</span><span class="err">'</span><span class="n">s</span> <span class="nl">password</span><span class="p">:</span> <span class="n">Connected</span> <span class="n">to</span> <span class="mf">52.202</span><span class="p">.</span><span class="n">XXX</span><span class="p">.</span><span class="n">XXX</span><span class="p">.</span> <span class="n">sftp</span><span class="o">&gt;</span> <span class="n">pwd</span> <span class="n">Remote</span> <span class="n">working</span> <span class="nl">directory</span><span class="p">:</span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">bob</span> <span class="n">sftp</span><span class="o">&gt;</span> <span class="n">bye</span>
Did you find this article helpful?
Previous

Launching into AWS GovCloud

Next