Dan Bikle
2014-May-09 22:34 UTC
[CentOS] CentOS 6.5 fresh install, public ssh keys cannot authenticate
Dear List, I cannot get public ssh keys to work in a fresh install of centos6.5 This might be a centos bug. I've googled for a solution. Mostly I found threads suggesting I debug sshd or run ssh -v for clues. Also I've seen threads suggesting I look at file and directory permissions. I dont think I should need to debug sshd after a fresh install. Also I think a fresh install should correctly set file and directory permissions. I think ssh should just simply work or I should see some simple documentation to make it work. Steps to reproduce this bug: Get the latest copy of virtualbox software. Get a centos6.5 dvd. Press the new button in virtualbox In the settings of the new install ask virtual box to setup a bridged adapter. Walk through the virtualbox wizard UI. When it asks for distribution point it at centos6.5 iso When the iso boots inside of virtualbox, choose to install desktop which is the first choice of choices. Eventually it will ask for a username, give the name of 'dan' and password paloalto9. When presented a login screen, login as dan. Start a terminal. try ssh: ssh dan at localhost That should prompt you for password and log you in. Also it should create ~dan/.ssh/ cd ~dan/.ssh/ do this: ssh-keygen That should create 2 files: ~dan/.ssh/id_rsa ~dan/.ssh/id_rsa.pub do this: cat ~dan/.ssh/id_rsa.pub > ~dan/.ssh/authorized_keys try: ssh dan at localhost It should log me in. Instead it prompts for password. I've walked through this type of scenario many times over the past few years and it has always worked. Currently it works well on ubuntu 12.04. I think something in centos6 might be broken? Perhaps there is a documented step somewhere which has been added to fresh centos installs which I missed? Dan
Greg Bailey
2014-May-09 22:42 UTC
[CentOS] CentOS 6.5 fresh install, public ssh keys cannot authenticate
On 05/09/2014 03:34 PM, Dan Bikle wrote:> Dear List, > > I cannot get public ssh keys to work in a fresh install of centos6.5[snip]> Steps to reproduce this bug:[snip]> do this: > > cat ~dan/.ssh/id_rsa.pub > ~dan/.ssh/authorized_keysI think you're missing: chmod 600 ~dan/.ssh/authorized_keys Without it, sshd won't use the authorized_keys file if it's readable by other users. (I think that's related to "StrictMode"; consult sshd man page) -Greg> > try: > > ssh dan at localhost > > It should log me in. > > Instead it prompts for password. > > I've walked through this type of scenario many times over the past few > years and it has always worked. > > Currently it works well on ubuntu 12.04. > > I think something in centos6 might be broken? > > Perhaps there is a documented step somewhere which has been added to > fresh centos installs which I missed? > > Dan > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos
Maybe Matching Threads
- Is it safe to go from CentOS6.5 to CentOS 7 at this time
- AuthorizedKeysFile with default value prevents Public/Private key authentication
- Error in 6.5 release notes?
- Problem with febootstrap version while compiling guestfsd in centos6.5
- update HOWTO page for how to copy ssh pub keys