Thursday, July 19, 2007

Random Linux Commands I Keep Forgetting

Enable root account in Ubuntu:

$ sudo passwd root


...then set a new password

Disable the root account in Ubuntu:

$ sudo passwd -l root


...which removes and locks the root account.

Manually set the eth0 IP, netmask and Gateway:

$ sudo ifconfig eth0 IPADDRESS netmask 255.255.255.0 broadcast BROADCASTIP
$ sudo route add default gw DEFAULTGATEWAYIP


To make changes permanent edit /etc/network/interfaces or put the above commands in /etc/init.d/rc.local

Manually set the Duplex and Speed of an Interface:

$ sudo ethtool -s eth0 speed 100 duplex full autoneg off
To make permanent put the command in /etc/init.d/rc.local.

No comments: