10 posts / 0 new
Last post
#1 Thu, 06/23/2016 - 15:57


I am trying to figure out how/where to configure authorized_keys file for ssh login.

I have no problem doing this on my other server. There it is /root/.ssh/authorized_keys

I cannot create a .ssh directory using filezilla. And I am not even sure that is where I would put it using virtualmin.

In cpanel, I see ssh menu but nothing there helped me. I guess the biggest mystery is why I cant create a .ssh directory.

Thu, 06/23/2016 - 16:08


You should be able to create any file or directory, so long as the user you're logged in as has permissions to do so.

Are you receiving a particular error when trying that?

Also, if you were to to log in as root over SSH, you could always just type "ssh localhost", and upon logging in again, it will create a .ssh directory for you -- then it's just a matter of creating the authorized_keys file.


Thu, 06/23/2016 - 16:39 (Reply to #2)

Very odd. Now I am able to create directories. Anyway, public key in home directory as advertised does work.

Thu, 06/23/2016 - 21:57

Great, glad to hear that's working now!


Sun, 06/26/2016 - 16:09

Although I can access server at the user level with ssh, I cannot figure out how to access the server through putty at the root level. Putty keeps opening up and asks me for user name and password. Which will get me in, but I have to constantly enter user name and pass. I cant find anything specific to root/putty/ssh on virtualmin with a google search.

Sun, 06/26/2016 - 17:44


Not all distributions allow root to log in over SSH.

What you may need to is log in as another user, and then use su or sudo to become root.

Or, if root doesn't have a password set, or could just be a matter of setting a password.


Sun, 06/26/2016 - 17:56 (Reply to #6)

root password was set as I was able to use putty to login to root with password. But that was a PITA to enter every time. I hear you on the sudo option. I was aware of that, but it just bugged me that I couldnt login with keys.

Sun, 06/26/2016 - 17:58

for some reason my solution didnt get posted.

I changed the putty ip to root@serverdomain and also had to create /root/.ssh/authorized_keys file with my public key inside the file. Make sure any key is continuous with no carriage returns.

I have two different ip addresses with linode. One is centos 6.5 and the other is my virtualmin with centos 7.0. With the centos 6.5 server putty worked fine with just the ip address. But with the centos 7 server, root@myserverdomain was necessary in order to connect to the server.

Wed, 06/29/2016 - 06:19 (Reply to #8)
unborn's picture

hi, you need to generate ssh key in putty - key generated on linux would not work for you. you need to use puttys format for key.

Configuring/troubleshooting Debian servers is always great fun

Wed, 06/29/2016 - 09:55
Diabolico's picture

Here you can find how to create SSH keys, its easy and it works: https://www.linode.com/docs/security/use-public-key-authentication-with-ssh

Dont forget to change settings inside "sshd_config" file to turn off password and force login only with keys.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Topic locked