Linux Installation And Server Management 32
If you are familiar with system administration, then you have used Linux system once or twice, if not everyday! Actually, these days system administration mainly refers to Linux system management. For this reason, having a good knowledge on Linux system is a must for system administrators. Here is A Must-have List of Linux Commands for Beginners. However, these commands are good for beginners, who are new to system administration. But for an advanced system administrator one should know more commands beyond these.
System Administration Commands
Of course, system administrator’s job area is huge! But, few common things every system administrator do are monitoring processes, terminating processes, checking disk spaces, freeing up disk spaces, viewing log files and many more. For this reason, in this article we will focus on the tools which are used to perform these tasks.
One of the main task of a system administrator is monitoring which process are running in a system. For this reason, there is a command ps. Actually this is one of the most used command. No doubt you can use many parameters with this command. Few examples are:
daredevil78@linux-i36u:~> ps – this will show the running process under current user, with process id.
daredevil78@linux-i36u:~> ps -ef – this will show various useful information. Few of them are User id, Process id, Parent Process id, Processor utilization time, and few more.
daredevil78@linux-i36u:~> ps –forest – this is a very nice command for watching parents and child process.
Actually, as a system administrator there will be many situation when you have to kill one or more running process. In this situation, you can two commands kill and killall.
daredevil78@linux-i36u:~> kill 380 – this command will kill the process with process id 380.
daredevil78@linux-i36u:~> killall http* – this command will kill all the processes starts with http.
Real-time Process Monitoring
Although, ps command show various information about running processes, it is not real-time monitoring. By using ps command we can see the running process for a particular time. For this reason, there is another command, top. This command shows running processes in real time.
daredevil78@linux-i36u:~> top – this command shows also shows running processes, but in real time. It additionally shows priority of a process, virtual memory used by a process, physical memory used by a process and few things more.
No doubt, you will run out of disk space at some point. For this reason, you have to monitor and free up disk space more often. There are two popular commands for this purpose.
daredevil78@linux-i36u:~> df -h – this command shows disk spaces in a human readable format. K for kilobyte, M for megabyte and G for gigabyte.
daredevil78@linux-i36u:~> du -s – this command shows a list of space used by directories and files. It also summarizes each arguments.
Finally, these are the 6 tools you can use in any Linux system. They are per-loaded with every Linux system. Although there are literally hundreds and thousands of Linux command, but mastering these commands will help you to done your job with more ease! So start practicing now!
Why Linux Commands Matter
Linux commands are reason behind the popularity of Linux operating system. Also it’s a operating system which is used in super computers to smart phones. So, having a working knowledge about Linux operating system is a great skill to have. Therefore it’s a mandatory skill for system administrator, network engineers, IT specialist, security analyst, cloud experts and many other types of professionals. So spending your time to learn Linux is actually a long-term investment.
If you haven’t installed Linux in your computer, then you should follow this link. There you will get a elaborated instructions on how to setup Linux in your computer. And after finishing Linux installation part, you are ready to go!
01. Complete offline manual
First Linux command we will see is man. It is a short form of manual. You don’t have to have internet connection or anything else to use this command. If you want to know about any commands, simply type man and then the command. For example, you want to know about the command ls. Then type man ls like below.
[daredevil78@localhost ~]$ man ls
After typing above command, you will get a detailed manual for the command ls. You can scroll through the manual for reading more.
Now suppose you don’t know the command you are looking for, then what you will do? Again you can use man command with -k parameter. -k is the short form of keyword. Suppose you want to see the available commands related to password. Then you can type
[daredevil78@localhost ~]$ man -k password.
This Linux command will show you all the available command related with password.
And if you want to know what man command can do, then type
[daredevil78@localhost ~]$ man man
02. Navigating Around Linux
In Linux system folders are called directory. If you want to move from one directory to another directory, then command is simple. It is cd. cd is the short form of change directory. You have to type cd and directory name.
[daredevil78@localhost ~]$ cd daredevil
If you type the above command, you will go to the directory named daredevil.
Now, if you want to go to one directory up, you have to type
[daredevil78@localhost ~]$ cd ..
If you want to go few directories up, then type
[daredevil78@localhost ~]$ cd ../../
And again, you can type [daredevil78@localhost ~]$ man cd to know about this Linux command in details.
03. Know your current location
Before navigating Linux file system, its better to know your present directory. There is a very useful command for this purpose. pwd, which is a short form of present working directory shows your current directory.
[daredevil78@localhost ~]$ pwd
04. Listing files and directories
After going to desired directory, you may want to see the files or contents of that directory. For that purpose you can use one of the shortest command, ls. ls is the short form of list. This command will list every file and directories of current directory.
[daredevil78@localhost ~]$ ls
There are many parameters you can use with ls commands. Few of them are listed below.
[daredevil78@localhost ~]$ ls -a – shows hidden files and directories.
[daredevil78@localhost ~]$ ls -R – shows files and directories recursively.
Below command will show long listing of directories with many information.
[daredevil78@localhost ~]$ ls -l
If you want information about a particular file or files with same pattern, then enter the commands below.
[daredevil78@localhost ~]$ ls -l file_name – shows information about file_name file.
[daredevil78@localhost ~]$ ls -l my?script – shows information about files matches given pattern.
[daredevil78@localhost ~]$ ls -l my* – shows information about files start with my.
05. Creating Files
In many cases, you have to create new files. For that you can use touch command with file name. If defined file name already exists, then its modification time will be changed.
[daredevil78@localhost ~]$ touch daredevil
06. Copying files
Copying files is one of the most common task you will do frequently. For copying a file the command is cp. cp stands for copy. cp command takes two argument at least. First one is source file and its location. Second command is destination for copied file.
[daredevil78@localhost ~]$ cp old_file new_file
Above Linux command will copy the old_file as new_file.
You can use many parameters with cp command. Some of them are explained below.
[daredevil78@localhost ~]$ cp -i source destination – asks before overwriting at destination.
[daredevil78@localhost ~]$ cp -R source/ destination – copies everything of source to destination.
07. Renaming files
If you want to change a file’s name or move it to a different directory, then mv is your command.
[daredevil78@localhost ~]$ mv fill fall – renames fill file to fall file.
[daredevil78@localhost ~]$ mv Scripts Old_Scripts – renames Scripts directory to Old_Scripts.
08. Deleting files
In Linux system, deleting a file or directory is done by rm command. You can use various parameter with this Linux command.
[daredevil78@localhost ~]$ rm -i fall – removes fall file with confirmation.
[daredevil78@localhost ~]$ rm -ri tamal – descends into tamal dir, removes file, then removes dir.
09. Viewing File’s content
To view a files content without opening it, you can use less command. Though it is called less, but it has many features. All you have to type less and desired file name.
[daredevil78@localhost ~]$ less log.txt
Above command will show you the contents of log.txt file without opening it in any text editor.
The beauty of Linux operating system is you can perform a task in many ways. Above commands are easiest yet powerful. But there are many other Linux commands which you can use to achieve the same output. So, do you know any easy and effective Linux commands except these? Please share with us in comments. Thank you all!
So you have read about Linux? You have heard about it’s awesomeness? And now you want to dive into the Linux world? But don’t know where to begin and how to take the first step? Then Congratulations! You have just found the easiest guide to Linux installation.
For the easiest Linux installation you need few things.
- A Linux ISO image file.
- A CD/DVD or a flash Drive
- [Optional] Virtualization Software
- And obviously a computer.
You can install Linux in your computer in more than one way, like.
- Installing Linux Virtually – Safest and easiest way with little/no limitations.
- Installing Linux Natively – Full blown Linux installation with little risk
- Using Live Linux distribution from Flash Drive – No risk but changes will be gone after restarting your computer.
In this post We will discuss about the first way, which is installing Linux virtually in your computer. Let’s get started!
01. Installing Linux Virtually
For this method you have to download two things. A virtualization software of your choice, I prefer VMware Workstation Player. Then you need an iso image of a Linux distribution of your choice. Again, I prefer CentOS 7. Here is the free download links you need:
VMware Workstation Player: https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html
If you are a Mac OS user, you may need to download Virtual Box, instead of VMware Workstation Player.
Installing VMware Workstation Player
If you have downloaded VMware Workstation Player from the above link, you will get an executable(.exe) file. Double click on that file and follow the installation instruction. You will be able to install this without any complexity.
Preparing a Virtual Machine for Centos 7
Follow the steps below to install CentOS 7 within VMware Workstation Player.
01. Creating a virtual machine: Open VMware Workstation Player and select “Create a New Virtual Machine”.
02. Selecting Operating System: In the next dialogue box, select “I will install the operating system later.”. Then click on “Next >”:
Then select “Linux” and “CentOS 7 64-bit” like the figures below.
04. Naming your virtual machine: Give your virtual machine a suitable name. Also select a folder for your virtual machine files.
05. Allocating resources for your virtual machine: In the next dialogue boxes define hard disk size, ram size, processor numbers.
Click “Finish” when you are done!
06. Selecting Linux iso image: Select newly created virtual machine. Then right click on it for “Settings”. Now select “CD/DVD (IDE)” and browse to where you have copied your CentOS 7 iso image. Select that file and click “OK”.
Installing CentOS 7 in Virtual Machine
Finally, it’s time to power on your virtual computer! Click on “Play Virtual Machine”.
01. Booting new computer from CentOS 7: After turning on virtual machine you will see a boot screen. Select “Install CentOS Linux 7”. Then in the next screen press “Enter”.
02. Selecting language and time zone: In this screen, select language as English. Also select your preferred time zone.
03. Flavor selection: In this step, select “Software Selection”. Then select “Server with GUI”. Finally click on “Done” .
04. Partitioning: This step is very important. Making a mistake in this step may cause your hard disk formatted. Click on “Installation Destination”. After that, select “I will configure partitioning” in the next dialogue box. Then select “Click here to create them automatically”. Then click “Done” and “Accept changes”.
05. Creating root password and another user: Now click on “Begin installation”. In the next screen set a strong root password and create a new user with password. Click on “Done” when finished.
06. Rebooting virtual machine: You can see file copy progress in below and a reboot button when done. Click on that button!
Logging into Linux World
Now you have done installing. Its time to log in to your CentOS 7.
01. Accepting License agreement: When you turn on the virtual computer for the first time, you will see a dialogue box below. Select “License Information”. Then accept the license agreement from below and click on “Done”. Now you can click on “Finish Configuration”.
02. Logging into CentOS 7: Now click on your username, input password and click on “Sign In”.
03. Tour to CentOS 7: After logging in you will see few little “house-keeping” settings. Select next and close the dialogue box.
04. Finalizing the Installation: You can use full screen mode in VMware Workstation player for a larger screen.
Now you have finished your first CentOS 7 installation. Enjoy!
Hi, today we’ll discuss about SFTP Server. SFTP stand for secure File Transfer Protocol. For the Setup sftp server linux, you can secure your system more. Sometimes it is highly recommended to use SFTP protocol in the file transfer service. It is considered as most secure file transfer system, because, there is a encryption technique between the client and the FTP server.
Setup sftp server linux
So to active the SFTP service we basically need the openssh server. If it is previously installed in your server then you need not to install it again. But if it is not installed then you need to install it. So we may consider that in our server openssh is not installed. So lets install it.
[root@localhost ~]# yum -y install openssh-server
Now you need to create a separate group for the FTP server and the access to the server.
[root@localhost ~]# groupadd ftpgrp
Now we need to open the openssh configuration file and need to make some change in it. You can make change as following:
Find and comment the below line ( Line no : 147 ).
#Subsystem sftp /usr/libexec/openssh/sftp-server
and add these lines below.
Match group ftpgrp
Now we need to restart the openssh server and its service.
[root@localhost ~]# systemctl restart sshd
So we can say that our service is configured and it is ready for work.
Now, what we can do, we can create user for the group we have created named as ftpgrp
[root@localhost ~]# useradd -m jim -s /sbin/nologin -g ftpgrp
[root@localhost ~]# passwd jim
So we have successfully created user. And now we need to change the permission of this user using the root user. Lets do this:
[root@localhost ~]# chown root /home/jim
[root@localhost ~]# chmod 750 /home/jim
Now lets create a directory in the www inside the home directory to change or modify the ownership.
[root@localhost ~]# mkdir /home/jim/www
[root@localhost ~]# chown jack:ftpgrp /home/jim/www
So the process completed, now you can access the SFT server using this new account. You may use different types of FTP client like Filezilla.
Now you may have a question in your mind that, we’ve made a FTP and SFTP server, so how a user can get access to both the servers. You just need to change the permission. From the previous post of FTP configuration, you may find that, we’ve created a user named jim. So we need to give jim user to access the newly created group of SFTP. Lets do this.
[root@localhost ~]# usermod jim -g ftpgrp
[root@localhost ~]# chown root /home/jim
[root@localhost ~]# chmod 750 /home/jim
[root@localhost ~]# mkdir /home/jim/www
[root@localhost ~]# chown jim:ftpgrp /home/jim/www
So we’ve successfully done this step. Hope that after this post, you will be able to configure SFTP server perfectly. If you have any kinds of question related to this post, then please feel free to comment. Have a nice day. 🙂
Hello all !! Hope that you are all well by the grace of almighty. Today we’ll enjoy configuring the setup ftp server linux.
Generally, FTP server can be configured using different types of software in Linux such as Samba server, ftpd, vsftpd. Here in this post we’ll mainly learn how to setup ftp server linux using vsftpd.
Setup ftp server linux
Generally FTP server is used for transferring file as FTP stands for File Transfer Protocol. So to communicate between a server and a network, a FTP server is necessary. We’ll configure FTP server in Linux. The steps shown here can be used in both CentOS and RedHat. I’ve shown the steps here is experimented in CentOS 7. So lets start it.
At first you need open the command terminal. Then need to log in as root user. See, here I’ve logged as root user:
[ece@localhost Desktop]$ su root
Now after doing that, you first need to check that, your YUM that is yellow update manager is updated or not. If not updated, then update it by using following command.
[root@localhost Desktop]# cd ~
[root@localhost ~]# yum update
If there is an update necessary, then it will update automatically if you have an active internet connection. And it will not update, if you have updated yum. So now lets move to the next step. Now we’ll install FTP software, which is vsftpd.
[root@localhost ~]# yum check-update
[root@localhost ~]#yum -y install vsftpd
Now after installing vsftpd, we’ll take a back up copy of this software.
[root@localhost ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.org
After that we’ll open this software using “nano editor command”
[root@localhost ~]#nano /etc/vsftpd/vsftpd.conf
We’ve opened the configuration file of that vsftpd.
Now make changes as following:
Now find this line anonymous_enable=YES ( Line no : 12 ) and change the value to NO to disable anonymous FTP access.
Uncomment the below line ( Line no : 100 ) to restrict users to their home directory.
and add the below lines at the end of the file to enable passive mode and allow chroot
Now we need to restart the vsftpd service and enable the service. So lets do this using command promote, that is command terminal.
[root@localhost ~]#systemctl restart vsftpd.service
[root@localhost ~]#systemctl enable vsftpd.service
Now we need to make some change to the firewall to allow access of the FTP service we have created and after that we need to reload or restart the firewall service.
[root@localhost ~]# firewall-cmd –permanent –add-service=ftp
[root@localhost ~]# firewall-cmd –reload
Now we need to make some changes to SElinux to allow the service of this FTP server also.
[root@localhost ~]# setsebool -P ftp_home_dir on
So we’ve almost finished configuring the FTP server, now you can create user for the FTP server. Please note that /sbin/nologin directory is created for disallow shell access to the server. So lets create user:
[root@localhost ~]# useradd -m jim -s /sbin/nologin
[root@localhost ~]# passwd jim
Now we’ve successfully created a user and now using this user we can now be able to log in using port no 21. We can take help different types of FTP client like filezilla to access the server using this user.
So hope that you’ve enjoyed setup ftp server linux. If you have any kinds od question related this post, feel free to comment and we’ll be very glad to help you.
Find Us on Facebook
Choose a category !!
- Cisco Certification Exam
- cisco packet tracer 6.2
- Cisco packet tracer 6.3
- Cisco Packet Tracer 7
- Cisco Packet Tracer 7.1
- Cisco Packet Tracer 7.2.1
- Cyber Security
- Engineering Ebooks
- Know computer
- Know your computer
- Laser Processing of Material
- Linux installation and server management