Logo
Back to home

Ubuntu Server 21.04

How to Change Hostname on Ubuntu 21.04
Aug 19, 2021 6.0k 108 minutes ago

How do you view your hostname? Step 1 : You need to use the hostname command or hostnamectl command hostname Step 2 : Output from the hostname command Setting the hostname Step 1 :Changing the hostname is fairly simple. To do this, we can use the hostnamectl command as root or with sudo. sudo hostnamectl set-hostname devtutorial Step 2 : Open the /etc/hosts file and change the old hostname to the new one. sudo nano /etc/hosts Step 3 : Verify the change hostname

How to set up ssh keys on ubuntu server 21.04
Aug 11, 2021 6.9k 108 minutes ago

Follow these steps to set up public key authentication: Step 1 : Change to the home directory with cd ~/ cd ~/ Step 2 : Create a .ssh directory if it doesn't already exist mkdir .ssh Step 3 : Create a file named authorized_keys under the .ssh directory touch .ssh/authorized_keys Step 4 : Set permissions on the .ssh directory to 700 chmod 700 .ssh Step 5 : Set permissions for authorized_keys to 600 chmod 600 .ssh/authorized_keys Step 6 : Generate public key pair on your local system with the

How to Set permissions on files and directories on ubuntu server 21.04
Aug 11, 2021 6.6k 82 minutes ago

Viewing permissions Step 1 : Use the ls command to list the access permissions of files and directories. ls -l Step 2 : In each line, we see several fields of information. 1 : The permission strings 2 : The link count for the object 3 : The user that owns the file 4 : The group that owns the file 5 : The size in bytes 6 : The file was modified 7 : The name of the file The permission strings Step 3 : Each permission string can be broken down into four groups, as I'll show you in the following

How to Add User to Sudoers in Ubuntu Server 21.04
Aug 11, 2021 5.0k 108 minutes ago

Add User to Sudoers Step 1 : To give additional users access to sudo, all you would need to do is add them to the sudo group sudo usermod -aG sudo myuser Configure sudo Step 2 : User with sudo privileges access to everything, and that may or may not be what you want. To actually configure sudo, we use the visudo command. sudo visudo /etc/sudoers By default, Ubuntu opens up the nano text editor when you use visudo. With nano, you can save changes using Ctrl + W, and you can exit the text editor

How to Manage passwords and password policies on ubuntu server 21.04
Aug 10, 2021 7.8k 108 minutes ago

Set an expiration date on a user's password Step 1 : Type chage -l username command to display expiration date on a user's password. sudo chage -l myuser Step 2 : When creating user accounts, The chage command allows you to force a password change for a user when he or she first logs in. sudo chage -d 0 myuser Step 3 : You can see the results of this command immediately if you run chage -l again against the user account you just modified: Step 4 : To set a user account to require a password c

How to Manage Groups on Ubuntu server 21.04
Aug 10, 2021 5.7k 108 minutes ago

List all groups Step 1 : The /etc/group file contains information regarding the groups that have been created on your system. Go ahead and take a look at this file on your system: cat /etc/group Creating new groups Step 2 : The groupadd command allows you to create new groups. sudo groupadd mygroup Step 3 : If you take a look at the /etc/group file again after adding a new group, you'll see that a new line was created in the file cat /etc/group Removing a group Step 4 : Removing a group is ju

How to Create and remove users on ubuntu server 21.04
Aug 07, 2021 6.2k 108 minutes ago

Creating users Creating users in Ubuntu can be done with one of either of two commands: adduser and useradd useradd Step 1 : First, Creating a User with specific home directory sudo useradd -d /home/username -m username Step 2 : If you list the storage of /home, you should see a folder listed there for our new user: ls -l /home Step 3 : To create a password for the user, we can use the passwd command. sudo passwd username adduser Step 4 : Execute adduser along with a username for a user you w

How to Install Ubuntu Server 21.04
Aug 02, 2021 6.1k 108 minutes ago

Step 1 : Insert the Ubuntu installation media into the appropriate drive, power on the system and follow the onscreen instructions to open the boot menu. The key you press at the beginning of the POST process differs from one machine to another, but it's quite often F10, F11, or F12. . Once you successfully boot from the media,  we can get right into the installation process by pressing Enter to choose the first option (Install Ubuntu Server) Step 2 : On the welcome screen, select your prefe