Month: May 2014

Sudo rights to group

When setting up a new Linux system you also need to set up a way to gain root access for you standard user account. This is relatively easy to do following
these simple steps as root:

Edit /etc/sudoers and find the following line and uncommit it by removing the ‘#’ from the second line:

## Uncomment to allow members of group sudo to execute any command
#%sudo ALL=(ALL) ALL

Add the useraccount you wish to grant sudo access to to the sudo group, where user is the user account you want to give sudo access to:

usermod -a -G sudo [user]

When logged in as this user, issue the following command to gain root access using your own password:

[daan@system] sudo su -

Leave a Comment

Find hosts in network using nmap

Sometimes you need to know what the IP address is of a certain system in the network. For example if you plug in a new device and need to know
which IP address it got assigned. In Linux the tool nmap can be used to scan the IP range of your local network. With the right parameters
it will report on the different system it has found.

On the console execute the following command, where you replace 192.168.121 with the IP range of your own network:

sudo nmap -sP 192.168.121.0/24

This will output something similar to the example below from which, hopefully, you can deduce which of the systems below is your system:

dean@box:~$ nmap -sP 192.168.121.0/24

Starting Nmap 5.21 ( http://nmap.org ) at 2014-04-10 20:47 CEST
Illegal character(s) in hostname -- replacing with '*'
Nmap scan report for Network (192.168.121.1)
Host is up (0.0067s latency).
Nmap scan report for Box (192.168.121.103)
Host is up (0.000056s latency).
Nmap scan report for Molvin (192.168.121.109)
Host is up (0.0013s latency).
Nmap scan report for 192.168.121.160
Host is up (0.0038s latency).
Nmap scan report for GameConsole (192.168.121.166)
Host is up (0.039s latency).
Nmap scan report for Tablet (192.168.121.198)
Host is up (0.037s latency).
Nmap scan report for android-xxx (192.168.121.238)
Host is up (0.067s latency).
Nmap scan report for 192.168.121.253
Host is up (0.0081s latency).
Nmap done: 256 IP addresses (8 hosts up) scanned in 4.42 seconds

Leave a Comment