Practical Training Report: Linux
Practical Training Report: Linux
on
LINUX
Session 2018-19
1. Introduction to Linux
1.1 Kernel
1.2 Linux Kernel
1.3 What is Linux?
1.4 Parts of a Linux OS
1.5 Difference between UNIX and LINUX
1.6 Advantages of Linux over other Operating
Systems
1.7 Popular Linux Distributions
1.8 What is Shell?
1.9 Basic Linux commands
2. Introduction to FTP
2.1 What is FTP?
2.2 What is an FTP Server?
2.3 Features of an FTP server
2.4 Working of FTP
2.5 Popular FTP Softwares
3. Project
3.1 About the project
3.2 Making a local FTP server in CentOS using vsftpd
3.2.1 vsftpd - FTP Server Installation
3.2.2 Anonymous FTP Configuration
3.3.3 User Authenticated FTP Configuration
3.3 Accessing the FTP server
KERNEL
pwd — When you first open the terminal, you are in the
home directory of your user. To know which directory you are
in, you can use the “pwd” command. It gives us the absolute
path, which means the path that starts from the root. The
root is the base of the Linux file system. It is denoted by a
forward slash( / ). The user directory is usually something like
"/home/username".
ls — Use the "ls" command to know what files are in the
directory you are in. You can see all the hidden files by using
the command “ls -a”.
cd — Use the "cd" command to go to a directory.
mkdir & rmdir — Use the mkdir command when you need to
create a folder or a directory.
rm - Use the rm command to delete files and directories. Use
"rm -r" to delete just the directory. It deletes both the folder
and the files it contains when using only the rm command.
touch — The touch command is used to create a file. It can
be anything, from an empty txt file to an empty zip file. For
example, “touch new.txt”.
man & --help — To know more about a command and how to
use it, use the man command. It shows the manual pages of
the command. For example, “man cd” shows the manual
pages of the cd command. Typing in the command name and
the argument helps it show which ways the command can be
used (e.g., cd –help).
cp — Use the cp command to copy files through the
command line. It takes two arguments: The first is the
location of the file to be copied, the second is where to copy.
mv — Use the mv command to move files through the
command line. We can also use the mv command to rename
a file. For example, if we want to rename the file “text” to
“new”, we can use “mv text new”. It takes the two
arguments, just like the cp command.
locate — The locate command is used to locate a file in a
Linux system, just like the search command in Windows. This
command is useful when you don't know where a file is saved
or the actual name of the file. Using the -i argument with the
command helps to ignore the case (it doesn't matter if it is
uppercase or lowercase).
echo — The "echo" command helps us move some data,
usually text into a file.
cat — Use the cat command to display the contents of a file.
It is usually used to easily view programs.
nano, vi — nano and vi are already installed text editors in
the Linux command line. The nano command is a good text
editor that denotes keywords with color and can recognize
most languages. And vi is simpler than nano. You can create a
new file or modify a file using this editor.
sudo — A widely used command in the Linux command line,
sudo stands for "SuperUser Do". So, if you want any
command to be done with administrative or root privileges,
you can use the sudo command.
df — Use the df command to see the available disk space in
each of the partitions in your system. You can just type in df
in the command line and you can see each mounted partition
and their used/available space in % and in KBs. If you want it
shown in megabytes, you can use the command “df -m”.
du — Use du to know the disk usage of a file in your system.
If you want to know the disk usage for a particular folder or
file in Linux, you can type in the command df and the name of
the folder or file.
apt-get — Use apt to work with packages in the Linux
command line. Use apt-get to install packages. This requires
root privileges, so use the sudo command with it.
chmod — Use chmod to make a file executable and to change
the permissions granted to it in Linux.
hostname — Use hostname to know your name in your host
or network. Basically, it displays your hostname and IP
address. Just typing “hostname” gives the output. Typing in
“hostname -I” gives you your IP address in your network.
What is FTP?
FTP stands for File Transfer Protocol.
A protocol is a system of rules that networked computers use
to communicate with one another.
FTP is a client-server protocol that may be used to transfer
files between computers on the internet.
The client asks for the files and the server provides them.
You can work with FTP using a simple command-line
interface, such as the DOS console in Windows and Terminal
in Linux and macOS.
If you don’t want to use those, though, there are graphical
user interface solutions, such as Filezilla or WS FTP Pro.
You can exchange any kind of file, including music, videos and
documents. If it’s a single file, you might even get it faster
than you would with HTTP, unless the server is far away.
What is an FTP Server?
For Windows:
FileZilla Server
Xlight FTP Server
Complete FTP
Cross FTP
For Linux:
FileZilla Server
vsftpd
proFTPD
Cross FTP
About the project
Finally, copy any files and directories you would like to make
available through anonymous FTP to /srv/files/ftp, or /srv/ftp
if you wish to use the default.
User Authenticated FTP Configuration
By default vsftpd is configured to authenticate system users
and allow them to download files. If you want users to be
able to upload files, edit /etc/vsftpd.conf:
Now when system users login to FTP they will start in their
home directories where they can download, upload, create
directories, etc.
Similarly, by default, anonymous users are not allowed to
upload files to FTP server. To change this setting, you should
uncomment the following line, and restart vsftpd:
Accessing the FTP server