Create, Delete, and Modify Local User Accounts, Modify Local Groups and Group Memberships

source : techrepublic

Today I will explain how to create a new user and grub on Linux.

The first
The first is to create a new user. Creating a new user is several ways, the first is

sudo useradd toni
and the second is

sudo adduser lulu
The difference is, if the useradd is immediately created without a password, so we have to set the password again, while the adduser is all included, so we are immediately asked to create a password, etc., as shown below:

Oh yes, if we want to make sure that the user who was already working, we can see it in the folder

cat / etc / passwd

The second
The second is delete user. Delete user is very easy, we only need to type the command

userdel (user name you want to delete)
The third
The third is to create a new user with the include file that we want to create. The trick, we create or copy the folder that we have in the directory or folder

/ etc / skel
The folder will appear in our new home directory user but does not appear in our home directory. The way is, we can’t file it before we create a new user

The fourth
The fourth is to create a new group. This group is useful for grouping users. So this might be very useful if we work in the company where there are many employees, maybe they can make grub for each division. Just like creating a user, there are two ways to create grub. The first:

addgroup (namagrup)
and

groupadd (namagrup)
The difference may be only a little, if the addgroup has some sort of process, the groupadd doesn’t exist.

And if we want to check an existing group, we only need to see it on

cat / etc / group
and to delete it, we only need to type the command

groupdel (group name you want to delete)
Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter or Instagram, which is listed at the bottom of my website.

Thanks.

Tutorial Learn Iptables

In this post, I will discuss about iptables.

source : iptables.info

Iptables is a tool in the Linux operating system that serves as a tool for filtering (filtering) (traffic) data traffic. Simply described as a data traffic regulator. With iptables, we will manage all traffic on our computer, whether it enters the computer, exits the computer, or traffic that just passes through our computer. source: http://dhetkj.blogspot.com/2011/06/pengertian-iptables.html?m=1

Just go straight to the practice

The first
iptables -A INPUT -p icmp –in-interface wlp3s0 -j ​​REJECT or DROP
The first is to block all IP people from being able to ping our IP. Well, there I gave the choice to have REJECT or DROP. The difference is, if we use the REJECT, then the person who wants to ping our IP will know the IP is rejected, while the DROP does nothing.

The second
iptables -A INPUT -i wlp3s0 -s 192.168.100.81 -j REJECT or DROP
The second is the same as above, but the difference is we only block certain IPs, or which IPs we want to block.

The third
sudo iptables -A INPUT -i wlp3s0 -p tcp -s 192.168.100.31/24 – port 22 -j REJECT or DROP
Third, we block all ip and port people from being able to enter our computers using SSH or telnet. This can be used to prevent hacking in our system later.

The fourth
sudo iptables -A INPUT -i wlp3s0 -p tcp -s 192.168.100.22 –dport 22 -j REJECT
The fourth is almost the same as the one above, only the difference, if the fourth one we block only certain IPs, so all of our IPs are blocked. This can be used for our friends who sometimes like to enter using SSH.

Bonus
In this bonus, I will explain the length of the parameters above.

-A = Add -i = Interfaces (ethernet card) -p = Protocol -s = Source -dport = Destination port -j = Jump (target)

Oh yes, to see the iptables list, we only need to type the command:

iptables -L
and to reset it, we only need to type

iptables -F
and all the settings that we made earlier will be as busy as before

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter or Instagram, which is listed at the bottom of my website.

Thanks.

Install WordPress use LNMP

source : rosehosting

Okay bro, sis, not posting for a long time because there are things that make me not post (read: lazy)

Let ‘s stick to the point, this time I will explain how to install WordPress on OS Linux.

The first
First we have to install Apache2 first, if you don’t already have one, you can see the post before this which discusses Apache2.

The second
What we need next is the MySQL server. How to install it like this

sudo apt-get install mysql-client mysql-server
it will pop up as below

and enter the root (admin) password that you want to enter.

But, your MySQL is not completely safe, we have to install one more thing, that is,

sudo mysql_secure_installation
First, you will be asked to install the ‘validate_password’ plugin, so press Yes (Y) and Enter. The most important thing is, if you don’t want to change the root password (admin), press No (N), then Yes (Y) afterwards.

The third
Next we have to install PHP and modules to work with the web and database. How to install it like this

apt-get install software-properties-common
After that

add-apt-repository ppa: ondrej / php
apt-get update
apt-get install php7.2
And to test whether the php works with the web server, we try to create a file called info.php in the / var / www / html folder

sudo nano /var/www/html/info.php
and paste the code below into the info.php file


If so, then open localhost / info.php, then it will look like this

The fourth
The last is to install WordPress. The first we have to download the latest wordpress (the newest wordpress) by:

wget -c http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
If you have, move the file from the folder that was extracted into Apache’s root folder

sudo rsync -av wordpress / * / var / www / html /
After that, we change the permissions of our website folder.

sudo chown -R www-data: www-data / var / www / html /
sudo chmod -R 755 / var / www / html /
The latter
The last thing is, installing Database for WordPress Type

mysql -u root -p
and type as below, enter each line

mysql> CREATE DATABASE wp_myblog;

mysql> GRANT ALL PRIVILEGES ON name-datebase. * TO ALTER USER ‘root’ @ ‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password-mu’;

mysql> FLUSH PRIVILEGES;

mysql> EXIT;
After that move to the / var / www / html folder and rename wp-config-sample.php to wp-config.php. After that update the contents with the same fields as you created in MySQL.

The trick is just to click, click, just as easy as making Facebook and other social media.

Source: https://www.tecmint.com/install-wordpress-on-ubuntu-16-04-with-lamp/

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Learn Docker

Source : esds.co.in

Hello gang! This time I will explain how to install docker on Ubuntu.

Previously, was the docker?

Docker is a platform built on container technology. Docker is an open-source project that provides an open platform for developers and sysadmins to be able to build, package and run applications anywhere as a lightweight container. With the very popular docker, some people often think docker is another name for containers. Source.

It’s easy like this,

Understand the meaning of the picture above? So, in one ship it can accommodate many containers in it, the concept is the same as the docker symbol. So, the docker can accommodate many applications, OS, and the like.

Immediately, I will tell you how to install it, follow the steps below

The first
The first we update the package first.

sudo apt update
After that, install some of the required packages

sudo apt install apt-transport-https ca-certificates curl software-properties-common
After all, add the GPG key

-fsSL curl https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
After that, add the Repository docker to APT source

sudo add-apt-repository “deb [arch = amd64] https://download.docker.com/linux/ubuntu bionic stable”
After that, it was updated to update the package or repo that we added to read

sudo apt update
Make sure we install the docker from the docker repository, not from the repository that has Ubuntu

apt-cache policy docker-ce
And the output will come out as below:

docker-ce:
  Installed: (none)
  Candidate: 18.03.1 ~ ce ~ 3-0 ~ ubuntu
  Version table:
     18.03.1 ~ ce ~ 3-0 ~ ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic / stable amd64 Packages
The last install the docker

sudo apt install docker-ce
Once installed, make sure if it is already installed by:

systemctl docker status
or if you can’t use systemctl, use this:

/etc/init.d/docker status
The second
If we have it installed, it’s all done, we just do what we want.

Well, we first try downloading the image first (the image is the same as .iso), how to, type it as below:

sudo docker pull ubuntu
Because I want to install Ubuntu, then what I pull is Ubuntu. If you want something else, try searching for Google what image is available on the docker.

After that, run it this way:

sudo docker run -i -t centos / bin / bash

Well, if we have entered, after that we exit the docker, we can see the process by:

sudo docker ps

Well, there is something similar to the docker ps, called docker images. So if in the docker images we can see the ID of the images that we have, and this will be used very much later. type

sudo docker images

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Tutorial KVM(QEMU)

Source : Researchgate

What is KVM
What is KVM? KVM (Kernel Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, which provides core infrastructure and certain processor virtualization modules, KVM-intel.ko or KVM-amd.ko. The QEMU KVM also needs to be modified even though work is underway to get the necessary changes. Source

It’s easy, just like virtualbox, it’s just easier. Yes, just go straight to the installation method.

The first
The first as usual, the cache update first

sudo apt-get update
Then

sudo apt-get install -y qemu-kvm qemu virt-manager virt-viewer libvirt-bin
qemu-kvm = Kernel-based Virtual machine, QEMU uses it for CPU virtualization.
qemu = CPU emulator
virt-viewer = for the GUI
The second
Install KVM, and virt manager

sudo virt-install –name = name –ram = 1024 –vcpus = 1 –cdrom = / var / lib / libvirt / images / CentOS-6.9-x86_64-minimal.iso –os-type = linux – disk path = / var / lib / libvirt / images / itzgeekguest.dsk, size = 4
–Name – Name the Virtual Machine as you like

-Ram – The amount of RAM in MB (adjust it to your RAM, if you have 4GB do not make more than that, it’s impossible. Because he took it from your original RAM)

-Vcpus – How much is the CPU (Just like RAM, if your CPU is just dual-core, don’t make it quad-core)

–Cdrom – The location of the ISO OS that you want to install

-Os-type – Type of OS such as: Linux, Windows, and Unix

-Os-variant – OS variant like RHEL 6 (If I’m emptied, because I mean it: D)

-Network – Networking (I also leave this blank, so he will set the default later)

–Graphics – Guest display settings (I also blank)

-Disk path – The location where we want to make, at least 4 GB

Well, later you will popup like this:

Instead, I took it from where I saw the tutorial:

Now, if we have installed it, we can open the virt-manager so that it is easy. Virt-manager is the GUI, so we just have to set the settings there to make it easier

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Linux Partition Use Fdisk

Hello guys, this time I will explain about partitions on Linux, actually there are actually applications that have GUIs, but if so, everyone can, because we should be different. Ha ha.

Oh yes, maybe this is a little difficult, and it can endanger your data, so I suggest using a virtual machine to try it.

The first
The first one we try to list partitions that we have, by typing

late
Later, the output will come out like this

The second
We enter into fdisk in a way

fdisk / dev / sdb (this matches the name of the device you have)
Because my device is called sdb then the results are like this

and if you want to see the guide, you type the letter “m”. Then it will come out like this

The third
Now, we will try to divide the sdb partition before, into several more parts

Command (m for help): n = new (create a new partition)
Partition type
   p primary (0 primary, 0 extended, 4 free)
   e extended (container for logical partitions)
Select (default p): p (main)
Partition number (1-4, default 1): Love the number is up to you, but if you just enter it, then it will set to default (1), and if there is one, then it will set directly (2), and so on.
First sector (2048-2360137, default 2048): (this just defaults to default)
Last sector, + sectors or + size {K, M, G, T, P} (2048-2360137, default 2360137): + 200M (size you want to give)

Created a new partition 1 of type ‘Linux’ and of size 200 MiB.

Command (m for help):
After that, let’s type p (print)

Before we share:

After sharing:

After that, try to exit fdisk by typing quit

And we type again and see the results

Now, we have divided the partition, then, where are the rest?

Calm down, the rest is still there, but we join it in another way, namely in this way

parted / dev / sdb (adjust to your respective device)
Then it will come out like this:

Now, how to combine the separate ones like this:

        copyright information of GNU Parted
(parted) mkpart (make part)
Partition type? primary / extended? primary (main)
File system type? [ext2]? ext4 (this is Linux default)
Start? 500MB (This is just about us, later the system will adjust itself)
End? 1100MB (Same as rich in the top, the system adjusts itself, even if the error later he will tell you what’s wrong)
(parted) (successful)
After that, try typing again, and you will see the rest will be allocated to the new partition

But it looks like this is not right, because I might be wrong, bro.

Bonus
Oh yes, for those of you who want to use a virtual-box, I suggest that the connection settings in the virtual-box we change so we can remove them using our original Linux terminal, because if we play in the virtual-box it will feel heavy.

Here’s how:

Follow what is drawn, then you will be able to uninstall it using ssh with your native Linux terminal intermediary. But don’t forget to install sh first, ok!

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Logical Volume Manager (LVM)

source : brainupdater.net

In this post, I will discuss LVM. What is LVM? LVM stands for Logical Volume Manager. Clearly, LVM is a method of allocating storage space to more flexible storage media than conventional partitions. LVM is another form of storage virtualization.

In general, LVM allows us to combine or combine several partitions and / or disks into one larger Logical Volume which then allows it to be changed, merged and or moved in the conditions being used. This means that no downtime is needed to increase or decrease storage capacity. This is useful because it does not interfere with the ongoing operational process. Logical Volume Management (LVM) is a disk management option that is almost available on every Linux distribution. Source.

Just go to the tutorial

Warning!
If we want to do it on our own laptop, without using a virtual box or something, I suggest backing up the data that you have first, because it can happen if the steps are wrong, the result will be fatal, the data you have may be lost.

The first
Just like the previous posting, if we haven’t created a partition, we make it first, the explanation is in that post. If you have, we just need to replace the type of partition from ext2 / ext3 / ext4 (depending on you) to LVM.

The second
If we already have a partition that we want to change, we just have to change it, this is how:

fdisk / dev / sdb (adjust to your device name), then follow the one below

Command (m for help): t
Partition number (1,2, default 2):
Partition type (type L to list all types): 8e (this is the lvm code)

Changed type of partition ‘Linux’ to ‘LVM Linux’.

Command (m for help): t
Partition number (1,2, default 2): 1
Partition type (type L to list all types): 8e

Changed type of partition ‘Linux’ to ‘LVM Linux’.

Command (m for help): w (this is for save)

The table partition has been altered.
Calling ioctl () to re-read partition table.
Syncing disks.
The third
Immediately, we immediately create Physical Volume in a way

pvcreate / dev / sdb1 / dev / sdb2
Adjust it to the device you want to make LVM, because I want to make sdb1 & 2, so I write it like that. After we type it, the output will come out like this:

After that, try typing

pvdisplay
the output will come out like this:

The fourth
Next we create a group volume

vgcreate tinydata (this is free, adjust what you want to do with the design) / dev / sdb1 / dev / sdb2 (adjust as usual)
Then the output will come out like this:

The fifth
Then, we create logical volumes, here I make it with the name tinydata. The way is this:

lvcreate –name logical-tiny –size 300M data

The fifth
Without a filesystem in a logical volume, we can not be sympathetic in it. Then we make it this way:

mkfs -t ext4 / dev / tinydata / logical-tiny

The sixth
Now, I will mount the logical volume. I will mount it on / mnt / teeny (it’s free), then we create the first folder in it

mkdir / mnt / teeny

or you can, you enter the folder / mnt / and mkdir inside it.
Then, we mount by:

mount / dev / tinydata / logical-tiny / mnt / teeny /
Adjust to what you make.

Then run it

df -h
Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Encrypted Partition

Source : techrepublic

Hello everyone, this time I will explain how we encrypt our partitions so that not everyone can open them.

And keep in mind, this post, still has to do with the 3 previous posts, which are about partitions.

Immediately we go to the first step

The first
Make sure before you start, the partition we want to encrypt is not mounted.

And here I will encrypt paritis sdb1

You can check your property by typing

late
Then, after making sure the partition we want to encrypt has not been mounted, we type it like this

cryptsetup luksFormat / dev / sdb1 (because I want to encrypt sdb1)

There we are asked to create a password

The second
After we lock, we must have the filesystem in the partition before we mount the partition. the way

mkfs -t ext4 / dev / mapper / whatever (free)
The third
We just mount it here, the way is, we first create a folder in / min /

free name
or
mkdir / mnt / free name
After that, we will mount it

mount / dev / mapper / whatever / min / whatever
And done!

If you want to lock an encrypted partition, type this command

umount / min / name that you made
cryptsetup luksClose the name you made

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Configure Systems to Mount File Systems at or During Boot

This time I will discuss about partitioning again.

Because not all patisi on Linux have been mounted every time we turn on the computer, it is not rich in practical windows. Every paritisation can be used immediately.

Here’s an example

above is my sdb1 partition mounted on / mnt / kadir before I restart. It appears there are several files in it. Now I restart, and I look again at the contents of the folder from / mnt / kadir, and the results are as below

Logically, it means that it hasn’t been read or it hasn’t been corrupted every time we restart it, now here I will explain how to make the partition stick or every time we restart or shut down our computer.

The first
What we need to know first, we have to know the UUID and our partition type must be ext4, how to check it here

blkid

If we don’t have ext4, change it at

mkfs -t ext4 / dev / sdb1
After we know the ID, we go to

nano / etc / fstab

UUID = a685a0c0-c9e0-4d32-91b8-ff18b12e1143 / mnt / kadir ext4 defaults 0 2
-The first block, UUID, enter the UUID of your partition that is on the BLKid

  • Block the second, where you mount your partition

-The third block, the type of your hard drive, the default Linux is the same

-The fourth block, just fill it with defaults

  • Block fifth, that’s the order he booted in what order, there we place 0 2, meaning he boots number 3.

Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.

Swap Space

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Actually, is that swap space? If the analogy is like this, for example we work in an office, now our work desk has a lot of tasks that must be done, so if there is a new file that is unloaded, the file space is created, so the files on our work table are not too full .

That’s the analogy, swap is like a backup memory.

Then, there are two ways to create swap memory, namely by using partitions, and using ordinary folders or files

First step
First, I will explain how to make swap memory using partitions.

How:

The first
Specify the partition that you will make swap memory.

Placeholder

I will become my sdb3 partition as swap memory.

How to?

mkswap / dev / sdb3
Then, to turn it on

swapon / dev / sdb3

Do you see the difference?

then, you can check whether it works on

free -mt
Placeholder

Then, if you want to reflect (make it permanent) when restarting it immediately appears, so we don’t turn on every time we turn on our PC.

How:

nano / etc / fstab
Add it

/ dev / sdb3 swap swap defaults 0 0
Placeholder

Adjust to the partitions that you have

Second way
Secondly, we use files for swap memory.

How:

The first
dd if = / dev / zero of = / root / myswapfile bs = 1M count = 1024
name after / root / myswapfile (this is free)

The second
The second we change the permissions to

chmod 600 / root / myswapfile
The third
Just like the first way

mkswap / root / myswapfile

then

swapon / root / myswapfile
After that, then we want to patent it like the first way, the method is the same

nano / etc / fstab

then add

/ root / myswapfile swap swap defaults 0 0
Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.

Thanks.