Custom Search
Showing posts with label software packages update. Show all posts
Showing posts with label software packages update. Show all posts

finger command in Ubuntu

Linux finger command prints user information in the system. You need to install finger package in order to use finger command because it's not installed by default. The finger command can be a threat to system security because attacker can gain information about the system. You can turn off the finger daemon or do not install it in the first place.




Why are we going to install it now? We need to know how the finger command works and see how it can danger our system. You can install finger using apt-get command as always:




luzar@ubuntu:~$ sudo apt-get install finger
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
libdns32 libisc32Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed: finger
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 18.0kB of archives.
After this operation, 77.8kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com hardy/main finger 0.17-11 [18.0kB]
Fetched 18.0kB in 0s (18.8kB/s)
Selecting previously deselected package finger.
(Reading database ... 18970 files and directories currently installed.)
Unpacking finger (from .../finger_0.17-11_i386.deb) ...
Setting up finger (0.17-11) ...
luzar@ubuntu:~$



Here is some information about finger command in manual page:





NAME

finger - user information lookup program

SYNOPSIS

finger [-lmsp] [user ...] [user@host ...]

DESCRIPTION

The finger displays information about the system users.



The finger command is a user information lookup program. What information can we see? We can check that later. The syntax can be as simple as finger user to look for local system and finger user@host for looking into remote system. That's powerful isn't it?




Let's see some finger command examples. Here is an example of finger command without any option or argument specified:




luzar@ubuntu:~$ finger
Login Name Tty Idle Login Time Office Office Phone
luzar luzar pts/0 Nov 22 03:01 (192.168.1.6)
root root *tty1 29 Nov 22 03:00luzar@ubuntu:~$



If no arguments are specified, finger will print an entry for each user currently logged into the system.




Let's say I want to check some information on user name james. I would write the command as:




luzar@ubuntu:~$ finger james
Login: james Name: James Labu
Directory: /home/james Shell: /bin/bash
Office: 133, 012345678 Home Phone: 098765432
On since Sat Nov 22 03:38 (EST) on tty2 15 seconds idle
(messages off)No mail.No Plan.
luzar@ubuntu:~$



I can also use -s to prints in different layout:




luzar@ubuntu:~$ finger -s james
Login Name Tty Idle Login Time Office Office Phone
james James Labu *tty2 17 Nov 22 03:38 133 012345678
luzar@ubuntu:~$



Everything we need to know about user information is there, login name, real name, home directory, shell used, office room and phone numbers, etc.




Now let's see another example with useful options. This time it's how to finger remote host. Use the format as in the example below:




luzar@ubuntu:~$ finger james@ubuntu



If you want to remove finger command from Ubuntu system, use the command in example below:




luzar@ubuntu:~$ sudo apt-get remove finger
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required: libdns32 libisc32Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED: finger
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
After this operation, 77.8kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 19000 files and directories currently installed.)
Removing finger ...
luzar@ubuntu:~$ sudo apt-get update



You can run apt-get update after that. Now test finger command again to if it's still running in our system.




luzar@ubuntu:~$ finger
-bash: /usr/bin/finger: No such file or directory
luzar@ubuntu:~$



That's it, no more finger daemon running.

Ubuntu update command line

Here is a guide for Ubuntu update in command line. There are two two commands you need to run. The first command is sudo apt-get update command to scan for available packages to update from Ubuntu support. If the update found a security patch or software packages update, then you need to run the next command which is sudo apt-get upgrade to install the updates. You must have Internet connection to run the command.

Here are example of Ubuntu update in command line:




luzar@ubuntu:~$ sudo apt-get update
Hit http://us.archive.ubuntu.com hardy Release.gpg
Get:1 http://security.ubuntu.com hardy-security Release.
gpg [189B]Ign http://security.ubuntu.com hardy-security/main Translation-en_US
Ign http://security.ubuntu.com hardy-security/restricted Translation-en_US
Ign http://security.ubuntu.com hardy-security/universe Translation-en_US
Ign http://security.ubuntu.com hardy-security/multiverse Translation-en_US
Get:2 http://security.ubuntu.com hardy-security Release [58.5kB]
Get:3 http://security.ubuntu.com hardy-security/main Packages [67.9kB]
Ign http://us.archive.ubuntu.com hardy/main Translation-en_US
Get:4 http://security.ubuntu.com hardy-security/restricted Packages [7159B]
Ign http://us.archive.ubuntu.com hardy/restricted Translation-en_US
Get:5 http://security.ubuntu.com hardy-security/main Sources [15.2kB]
Ign http://us.archive.ubuntu.com hardy/universe Translation-en_US
Get:6 http://security.ubuntu.com hardy-security/restricted Sources [1092B]
Ign http://us.archive.ubuntu.com hardy/multiverse Translation-en_US
Get:7 http://security.ubuntu.com hardy-security/universe Packages [41.2kB]
Get:8 http://us.archive.ubuntu.com hardy-updates Release.gpg [189B]
Get:9 http://security.ubuntu.com hardy-security/universe Sources [7068B]
Ign http://us.archive.ubuntu.com hardy-updates/main Translation-en_US
Ign http://us.archive.ubuntu.com hardy-updates/restricted Translation-en_US
Ign http://us.archive.ubuntu.com hardy-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com hardy-updates/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com hardy Release
Get:10 http://us.archive.ubuntu.com hardy-updates Release [58.5kB]
Get:11 http://security.ubuntu.com hardy-security/multiverse Packages [8637B]
Get:12 http://security.ubuntu.com hardy-security/multiverse Sources [14B]
Hit http://us.archive.ubuntu.com hardy/main Packages
Hit http://us.archive.ubuntu.com hardy/restricted Packages
Hit http://us.archive.ubuntu.com hardy/main Sources
Hit http://us.archive.ubuntu.com hardy/restricted Sources
Hit http://us.archive.ubuntu.com hardy/universe Packages
Hit http://us.archive.ubuntu.com hardy/universe Sources
Hit http://us.archive.ubuntu.com hardy/multiverse Packages
Hit http://us.archive.ubuntu.com hardy/multiverse Sources
Get:13 http://us.archive.ubuntu.com hardy-updates/main Packages [378kB]Get:14 http://us.archive.ubuntu.com hardy-updates/restricted Packages [7103B]Get:15 http://us.archive.ubuntu.com hardy-updates/main Sources [98.7kB]Get:16 http://us.archive.ubuntu.com hardy-updates/restricted Sources [1092B]Get:17 http://us.archive.ubuntu.com hardy-updates/universe Packages [141kB]Get:18 http://us.archive.ubuntu.com hardy-updates/universe Sources [32.6kB]Get:19 http://us.archive.ubuntu.com hardy-updates/multiverse Packages [23.8kB]Get:20 http://us.archive.ubuntu.com hardy-updates/multiverse Sources [4020B]
Fetched 953kB in 34s (27.9kB/s)Reading package lists... Done
luzar@ubuntu:~$


Running the apt-get upgrade command:


luzar@ubuntu:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
bind9 bind9-host dnsutils libbind9-30 libisc32 libisccc30 libisccfg30
linux-image-server linux-server
The following packages will be upgraded:
apt apt-utils bind9-doc cpp-4.2 eject gcc-4.2-base initramfs-tools
iproute libapache2-mod-php5 libc6 libc6-i686 libdbus-1-3 libgcc1
libldap-2.4-2 liblwres30 libpcre3 libstdc++6 libxml2
linux-image-2.6.24-19-server pciutils php5-common php5-mysql
postfix procps python2.5 python2.5-minimal sudo tzdata ufw
update-manager-core xkb-data
31 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Need to get 40.7MB of archives.After this operation, 24.6kB of additional disk space will be used.Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com hardy-updates/main
gcc-4.2-base 4.2.4-1ubuntu3 [100kB]
Get:2 http://us.archive.ubuntu.com hardy-updates/main libgcc1 1:4.2.4-1ubuntu3 [23.3kB]
Get:3 http://us.archive.ubuntu.com hardy-updates/main cpp-4.2 4.2.4-1ubuntu3 [2486kB]
Get:4 http://us.archive.ubuntu.com hardy-updates/main libstdc++6 4.2.4-1ubuntu3 [332kB]
Get:5 http://us.archive.ubuntu.com hardy-updates/main libc6 2.7-10ubuntu4 [4307kB]12% [5 libc6 2299022/4307kB 53%] 201kB/s 2min56