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.
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.
Very odd. Now I am able to create directories. Anyway, public key in home directory as advertised does work.
Great, glad to hear that’s working now!
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.
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.
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.
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.
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.
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.