Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up a jailed SFTP user account on my own local machine to test an application with libcurl. I used this guide to help me figure out how to set up a jailed SFTP user: http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/

The guide does work, but I'd like to set up public-key authentication to log in to the SFTP user's account instead of using a password. I have some basic understanding of generating and authorizing private and public keys from this guide: http://www.cyberciti.biz/tips/ssh-public-key-based-authentication-how-to.html

However, trying to add an authorized_keys2 directory in the sftp user's home directory doesn't seem to work. Any tips or advice would be helpful.

share|improve this question
up vote 3 down vote accepted

You don't need a directory authorized_keys2, you need a directory ~/.ssh and in that directory a file authorized_keys2.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                    <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2016.5.6.3550\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. <br>This site is not affiliated with Linus Torvalds or The Open Group in any"], "copyright__copyright__copyright": ["ectory in the sftp user's home directory doesn't seem to work. Any tips or advice would be helpful.\n\nshare|improve this question\nup vote 3 down vote accepted\n\nYou don't need a directory authorized_keys2, you need a directory ~/.ssh and in that directory a file authorized_keys2.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}