Everything is Linux

Monday, November 24, 2014

FTP Configuration in RHEL7

                In this scenario, local Repository has been built with Operating System Media so that packages get installed from media,

In RHEL, as same as in previous versions, ftp services served by the package/daemon called vsftpd i.e. Very Secure FTP Daemon,
[root@linux ~]#
[root@linux ~]#
[root@linux ~]# yum install vsftpd

Command to install VSFTPD package is as follows,

[root@linux ~]# yum install vsftpd
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local                                                                                                                                 | 4.1 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================
 Package                             Arch                                Version                                    Repository                          Size
====================================================================
Installing:
 vsftpd                              x86_64                              3.0.2-9.el7                                local                              166 k

Transaction Summary
====================================================================
Install  1 Package

Total download size: 166 k
Installed size: 343 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : vsftpd-3.0.2-9.el7.x86_64                                                                                                                 1/1
  Verifying  : vsftpd-3.0.2-9.el7.x86_64                                                                                                                 1/1

Installed:
  vsftpd.x86_64 0:3.0.2-9.el7

Complete!
[root@linux ~]#

Once the installation of package completes, enable the vsftpd service at startup. This can be done using the following command,

[root@linux ~]# systemctl enable vsftpd.service
ln -s '/usr/lib/systemd/system/vsftpd.service' '/etc/systemd/system/multi-user.target.wants/vsftpd.service'
[root@linux ~]#

Then start the service using systemctl as below,

[root@linux ~]# systemctl start vsftpd.service
[root@linux ~]#

Now FTP Service is enabled and available for localhost. To make available through LAN or outside network, this has to be enabled through firewall,

To do the same, following is the command to allow ftp through firewall,

[root@linux ~]#
[root@linux ~]# firewall-cmd --permanent --add-service=ftp
Success

To save the rule, execute the following command,
[root@linux ~]# firewall-cmd --reload
success
[root@linux ~]#


Now we are ready with FTP Server configuration. From any other machine, just go to browser and type ftp://192.168.x.x/ and it will open list of files which are available in FTP default directory


Labels: , ,

Wednesday, November 19, 2014

Quiz3 - RHEL7 Introduction

RHEL7 - Introduction
1.       What is the default filesystem in RHEL7?
ext4
ext5
xfs
ext3

2.       Does RHEL7 support container?
Yes
     No

3.       RHEL7 is available only as 64 bit operating system.
True
             False

4.       Which is the new boot loader included in RHEL7?
LILO
Yaboot
Grub2
Grub3

5.       Which is the new system and service manager introduced in RHEL7 which is not on previous versions of RHEL?
init2d
systemd
sysd              
sysV

6.       What is the command line tool provided to allow users to interact with NetworkManager
nmi
nmcli
nmcmi
nmedit

7.       How to start the service in RHEL7?
systemctl start
chkconfig start
systemd start
initctl start

8.       Which is the new service unit introduced in RHEL7 for managing firewall?
iptables2
firewalld
firewall2
ip2tables

9.       Is NFSv2supported in RHEL7?
Yes
No

10.   What is the alternate command against "resize2fs" in RHEL7 with xfs filesystem?
xfsgrowfs
xfs_growfs
resizexfs
extendxfs


                

Quiz2 - Red Hat Linux


Red Hat Linux - 2
1.       What is the command to install rpm package in Linux?
rpm -I packagename
rpm -i packagename
rpm -a packagename
rpmpkg -i packagename
2.       What is the command to check the detailed information about installed package?
rpm -qi packagename
rpm -qI packagename
rpm -l packagename
rpm -q packagename
3.       What is the command to check list of files installed by any package?
rpm -ql packagename
rpm -h packagename
rpm -i packagename
rpm -D packagename
4.       Create new logical volume with 25 extends with the name "database" in volume group vg1?
lvcreate -l 25 -n /dev/vg1/database
lvcreate -e 25 /dev/vg1/database
lvcreate -L 25 database
lvcreate -E 25 /dev/database
5.       what is the command to delete all the rules of iptables immediately?
iptables -D
iptables -F
iptables -R
iptables -d

6.       What is the command to check whether package is installed?
rpm -q packagename
rpm -ll packagename
rpm -l packagename
rpm -Q packagename
7.       Expand NTP
Network Time port
Network Time protocol
Network Transfer protocol
Network transfer port
8.       Which is the default MTA used in RHEL 6?
sendmail
postfix
qmail
rainmail
9.       which is the default file system in RHEL 6?
ext4
ext5
ext3
xfs
10.    Create a user raja with id 1456 and he should not have interactive login shell
useradd -x nologin raja –U 1456
useradd -S /bin/nologin –u 1456raja
useradd -s /sbin/nologin –u 1456 raja
useradd -s login disable –u 1456 raja

Quiz1 - Red Hat Linux

Red Hat Linux

1. Communication through telnet is in encrypted form. True or False?

a. True
b. False


2. in which file, default runlevel is set?

a. /etc/init.conf
b. /etc/rc.sysinit
c. /etc/boot.conf
d. /etc/inittab

3. Which is the option used along with ls to see hidden files in a directory?

a. -a
b. -h
c. -s
d. -A

4. Which is the default configuration file for FTP Daemon/Service?

a. /etc/ftp.cfg
b. /etc/vsftpd/vsftpd.conf
c. /etc/sftpd/sftpd.conf
d. /etc/ftp.conf

5. Which file should be edited to set hostname?

a. /etc/hosts
b. /etc/sysconfig/network
c. /etc/nss.conf
d. /etc/hosts.allow

6. What is the command to delete all the iptable rules?

a. iptables -D
b. iptables -F
c. iptables -d
d. iptables delete all

7. How to get list of files installed by a package? (Package already installed in system)

a. rpm -qf package name
b. rpm -ql package name
c. rpm -qv package name
d. rpm -qd package name

8. Which is the following are correct with respect to service and port?

a. telnet-23, ssh-22, smtp-25
b. telnet-22, ssh-25, smtp-110
c. telnet-22, ssh-25, pop=110

9. Is it possible to configure password less login between two servers through ssh session?

a. Yes.
b. No

10. What is the command to see IP configuration in a system?

a. ifconf
b. ifconfig
c. ipconfig

d. ifnet