SYSTEM ADMIN COMMANDS

 

INSTALLING SOFTWARE

 

Procedure:

      Open the Ubuntu software Center.

      To install any package, open the terminal (Ctrl + Alt + T) and type sudo apt-get install

<package name>.

      For instance, to get Chrome type sudo apt-get install chrome-browser.

      Likewise user can work package update, remove and reinstall the package using the following commands.

 

To update the package repositories

sudo apt-get update

To update installed software

sudo apt-get upgrade

 

To install a package/software

sudo apt-get install <package-name>

 

To remove a package from the system

sudo apt-get remove <package-name>

 

To reinstall a package

sudo apt-get install <package-name> --reinstall

 

To completely remove a software and it’s dependent packages run the apt-get purge

sudo apt-get purge <package-name>

 

To remove all Debian (.deb) files those are no longer installed

---files in /var/cache/apt/archives

sudo apt-get autoclean

To empty whole cache files – to reduce the space consumption

sudo apt-get clean


 

To remove old dependent files and footprints installed by previous applications

sudo apt-get automove

To configure installed package

sudo dpkg –configure –a

 

To download but not install package

sudoapt-get download <package-name>

 

MANAGING USERS

      Managing users is a critical aspect of server management.

      In Ubuntu, the root user is disabled for safety.

      Root access can be completed by using the sudo command by a user who is in the “admin” group.

      When you create a user during installation, that user is added automatically to the admin group.

To add a user:

sudo adduser username

To disable a user:

sudo passwd -l username

To enable a user:

sudo passwd -u username

To delete a user:

sudo userdel –r username

To create a group:

sudo addgroup groupname

To delete a group:

sudo delgroup groupname

To create a user with group:

sudo adduser username groupname

To see the password expiry value for a user,

sudo chage -l username

To make changes:

sudo chage username


GUI TOOL FOR USER MANAGEMENT

 

GUI Tool allow the admin to run the commands in terminal to manage users and groups.

 

To install a GUI add-on

 

sudo apt install gnome-system-tools

 

Once done, type

 

users-admin

 

MANAGING THE FILE SYSTEM

A filesystem is a permanent storage for containing data. Any non-volatile storage device like hard disk, usb etc has a filesystem in place, on top of which data is stored. While installing Linux, you may opt for either EXT4 or EXT3 file system.

Ext3 : A journaling filesystem: logs changes in a journal to increase reliability in case of power failure or system crash.

EXT4: It is an advanced file syste. This file system supports 64-bit storage limits, columns up to 1 exabytes and you may store files up to 16 terabytes

Disk Partitions can be viewed by the command sudo fdisk -l

File system information are available in the file /etc/fstab

 

MANGING THE NETWORK CONFIGURATION

 

Most networking is configured by editing two files:

              /etc/network/interfaces

o      Ethernet, TCP/IP, bridging

              /etc/resolv.conf

o      DNS

Other networking files:

       /etc/hosts

       /etc/dhcp3/dhcpd.conf

To test any host’s connectivity

ping <ip-address>

       To start/stop/restart/reload networking services

sudo /etc/init.d/mnetworking <function>


 

Note : <function> can be any one of stop or start or reload or restart

To list of all active network interface cards, including wireless and the loopback interface

sudo ifconfig

To display host Fully Qualified Domain Name

sudo hostname

To display arp table (ip to mac resolution)

sudo arp –a

To remove entry from arp table

sudo arp –d <user name>

To display or change network card settings, use ethtool

sudo ethtool eth0

To displays extensive status information when queried with the service iptables status command

sudo service iptables status

To start/stop services

sudo service iptables start/stop

 

INSTALLING INTERNET SERVICES

Installing Apache server

sudo apt-get install apache2

Configuration file for Apache server

apache2.conf

        Restart apache services after any configuration changes made

sudo /etc/init.d/mnetworking restart

Similarly all services can be installed, configured and restarted

 

MANAGING BACKGROUND JOBS

 

To display jobs running in background

sudo jobs

To check the process id of background processes

              sudo jobs –p

To bring a background job to the foreground

sudo fg

To start the Jobs suspended in background

sudo bg


 

QUESTIONS FOR PRACTICE:

Q1. Update the package repositories

 

 

Q2. Install the package “simplescreenrecorder”

 

 

 

Q3. Remove the package “simplescreenrecorder”

 

 

 

Q4. Create a user ‘elias’. Login to the newly created user and exit.

 

 

 

Q5. Disable the user ‘elias’, try to login and enable again.

 

 

 

Q6. Create a group ‘cse’ and add the user ‘elias’ in that group

 

 

Q7. List the account expiry information of the user ‘elias’

 

 

 

Q8. Change the ‘Number of days warning before password expires’ as 5 for the user ‘elias’

 

 

Q9. Delete the user ‘elias’ and then delete the group ‘cse’

 

 

Q10. List the partitions available in your system


Q11. What are the file systems used in your system

 

 

Q12. Stop the networking service and then start the service

 

 

Q13. Check the connectivity of the host with IP address 127.0.0.1

 

 

 

Q14. Find the IP address of the localhost

 

 

Q15. Find the IP address of the DNS Server (name server)

 

 

 

Q16. Install mysql server

 

 

Q17. Restart mysql server

 

 

Q18. Check the configuration file for mysql server

 

 

Q19. Log on as root into mysql server

 

 

Q20. Create a new database for mysql server

 

Post a Comment

Previous Post Next Post