By setec
I have SSH keys setup for access for root and the one regular user I added.
I would like to:
Disable remote root login of any kind.
Allow user1 to sudo without password once logged in via SSH keys.
Disallow remote logins of any kind without SSH keys (disable password use completely).
Allow SFTP connections with SSH keys only.
Can anyone help by telling em the steps I have to take?
This app install runs Ubuntu 14.04
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The tutorial Initial Server Setup with Ubuntu 14.04 will walk you through creating a non-root accout with SSH keys and disabling SSH access completely for the root account. Since SFTP uses SSH, once you’ve set that up, SFTP access will also be disabled for the root user.
That should point you in the right direction. Let us know if you run into any problems!
Here is the answer without thousands of words and external links in three simple steps.
Add the line below to /etc/sudoers
username ALL=(ALL) NOPASSWD:ALL
Edit /etc/ssh/sshd_config and change (and uncomment if necessary) the line, default is probably ‘yes’:
PermitRootLogin no
Also edit/change/uncomment:
PasswordAuthentication no
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.