This article describes essential configuration steps you should follow for digital ocean initial ubuntu server setup.
Contents:
Step 1: Create a non-root user with sudo rights
In the following code, replace the expression your_username
with a username that you like.
# Login to your droplet as root
ssh root@your_server_ip
# Create a non-root user with sudo/admin privileges
adduser your_username
sudo usermod -aG sudo your_username
# Switch from the root to the new username
su - your_username
Step 2: Set up a basic firewall
In the following code, UFW
corresponds to Uncomplicated FireWall. The UFW
application is used to enable/disable connections to certain services.
# Enable firewall
sudo ufw enable
# Add SSH service to allow SSH connection
sudo ufw allow OpenSSH
Other useful commands:
# Inspect allowed services/application
sudo ufw status
sudo ufw app list
# Disable UFW
sudo ufw disable
Step 3: Add SSH keys for automatic authentication
Add SSH keys for automatic authentication without entering a password. From your local machine, type the following bash code:
# Create ssh key if you don't have one
ssh-keygen -t RSA -b 4096 -C "personal_machine"
# Copy the public keys to the droplet’s root account
ssh-copy-id your_username@your_server_ip
# Test your SSH connection by using your new log in credentials
ssh your_username@your_server_ip
Read more: Add SSH Keys to Existing Droplet
Step 4: Add swap
If your server has small RAM, you will need to configure some SWAP, for example 4GB swap.
# Add swap
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
sudo sh -c 'echo "/var/swap.1 swap swap defaults 0 0 " >> /etc/fstab'
Recommended for you
This section contains best data science and self-development resources to help you on your path.
Coursera - Online Courses and Specialization
Data science
- Course: Machine Learning: Master the Fundamentals by Stanford
- Specialization: Data Science by Johns Hopkins University
- Specialization: Python for Everybody by University of Michigan
- Courses: Build Skills for a Top Job in any Industry by Coursera
- Specialization: Master Machine Learning Fundamentals by University of Washington
- Specialization: Statistics with R by Duke University
- Specialization: Software Development in R by Johns Hopkins University
- Specialization: Genomic Data Science by Johns Hopkins University
Popular Courses Launched in 2020
- Google IT Automation with Python by Google
- AI for Medicine by deeplearning.ai
- Epidemiology in Public Health Practice by Johns Hopkins University
- AWS Fundamentals by Amazon Web Services
Trending Courses
- The Science of Well-Being by Yale University
- Google IT Support Professional by Google
- Python for Everybody by University of Michigan
- IBM Data Science Professional Certificate by IBM
- Business Foundations by University of Pennsylvania
- Introduction to Psychology by Yale University
- Excel Skills for Business by Macquarie University
- Psychological First Aid by Johns Hopkins University
- Graphic Design by Cal Arts
Amazon FBA
Amazing Selling Machine
Books - Data Science
Our Books
- Practical Guide to Cluster Analysis in R by A. Kassambara (Datanovia)
- Practical Guide To Principal Component Methods in R by A. Kassambara (Datanovia)
- Machine Learning Essentials: Practical Guide in R by A. Kassambara (Datanovia)
- R Graphics Essentials for Great Data Visualization by A. Kassambara (Datanovia)
- GGPlot2 Essentials for Great Data Visualization in R by A. Kassambara (Datanovia)
- Network Analysis and Visualization in R by A. Kassambara (Datanovia)
- Practical Statistics in R for Comparing Groups: Numerical Variables by A. Kassambara (Datanovia)
- Inter-Rater Reliability Essentials: Practical Guide in R by A. Kassambara (Datanovia)
Others
- R for Data Science: Import, Tidy, Transform, Visualize, and Model Data by Hadley Wickham & Garrett Grolemund
- Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems by Aurelien Géron
- Practical Statistics for Data Scientists: 50 Essential Concepts by Peter Bruce & Andrew Bruce
- Hands-On Programming with R: Write Your Own Functions And Simulations by Garrett Grolemund & Hadley Wickham
- An Introduction to Statistical Learning: with Applications in R by Gareth James et al.
- Deep Learning with R by François Chollet & J.J. Allaire
- Deep Learning with Python by François Chollet
Version: Français
No Comments