Linux Questions & Answers

General discussion about Linux, Linux distribution, using Linux etc.

Linux Questions & Answers

Postby wacky » Mon Aug 10, 2009 1:19 am

1) In Redhat (also Centos or Fedora) how would you list the last 10 packages installed and their installation times?

rpm -qa --last | head

2) What file contains the file system sharing table?

/etc/exports

3) In Redhat (also Centos, Fedora) what command and switches would you use to install and monitor the progress of a package?

rpm -ivh

4) What command would you use to copy MBR from /dev/hda to /dev/hdb?

dd if=/dev/hda of=/dev/hdb bs=512 count=1

5) What command would you use to display the loadable kernel modules currently active?

lsmod

6) Next time the machine is rebooted we want a virtual NIC created on eth0, what file needs to be created to do this?

/etc/sysconfig/network-scripts/ifcfg-eth0:1

7) In realtime how can you stop IP forwarding?

echo 1 > /proc/sys/net/ipv4/ip_forward

8) Same as Q7 but we want it sustained after reboots. What needs to be done?

sysctl -w net.ipv4.ip_forward=1
or
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf

9) You have been asked to decommission a Linux server and wipe all sensitive data from disk /dev/hdb. How would you do this?

shred /dev/hdb
wacky
Naik
 
Posts: 94
Joined: Thu Jun 10, 2004 7:42 pm
Location: London, UK

Postby lambda » Mon Aug 10, 2009 1:39 am

sysctl -w net.ipv4.ip_forward=1 doesn't work across reboots, unless you put it in some file like /etc/rc.local.

i think you meant "start", not "stop".
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby wacky » Mon Aug 10, 2009 1:40 pm

lambda wrote:sysctl -w net.ipv4.ip_forward=1 doesn't work across reboots, unless you put it in some file like /etc/rc.local.

i think you meant "start", not "stop".


Lambda, you're correct. This is my mistake. sysctl -w does not work across reboots. Also there is another glaring mistake:
net.ipv4.ip_forward=0 to disable IP forwarding not 1 as in my answer above.
wacky
Naik
 
Posts: 94
Joined: Thu Jun 10, 2004 7:42 pm
Location: London, UK


Return to “%s” General

Who is online

Users browsing this forum: No registered users and 2 guests

cron