Newbie Server questions (Website down post reboot &SSH keys)

January 28, 2019 604 views
Ubuntu 16.04 Initial Server Setup Ubuntu Security

Hi there,

I’m very new to digital ocean (apologizes for lack of knowledge). I have been trying for days to get FTP or SFTP access into my droplet, and every time it’s coming back at me with public key error. After searching around, it’s due to SSH key pairs. So I generated a pair and tried to upload the public pair to my server, but got rejected again for public pair error. I have been following all the tutorials from DigitalOcean so I’m at a loss for what to do.

I’m now stuck because I had to reboot the droplet last night for increase in capacity, and now my site has gone dark. I can’t figure out how to “reinitiate” web hosting? And I can’t even get into the server through FTP to get access to my files.

Unfortunately I am not the one who set this site up so I am not the most familiar with it, and of course those who set it up at MIA.

Any help at this point would be more than appreciated. I am starting to lose it with how overly complicated this has become.

(I have root access and can log into the console, plus please keep it fairly simple because I don’t have the technical language of Ubuntu yet)

Thanks so much,
Colin

1 Answer

Greetings!

I’m sorry about the trouble this is causing for you. While I recommend SSH keys, I think they can be an extra layer of confusion for someone going through all of this for the first time. In my opinion, master this workflow with passwords first, and then graduate to keys.

In /etc/ssh/sshd_config, make sure these variables are set to the following values:

PermitRootLogin yes
PasswordAuthentication yes
Subsystem       sftp    /usr/lib/openssh/sftp-server

Then restart SSH:

systemctl restart ssh

If you need help editing the file from our console, check out this guide:
https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/

You should then be able to use password login from your FTP client, using the SFTP (not FTPS) protocol over port 22. Keep your password significantly difficult, never forget the greatest eye opener: https://xkcd.com/936/

Jarland

Have another answer? Share your knowledge.