Tuesday, 16 August 2011

Linux Tips

Add Ubuntu to windows server 2003 Active Directory Domain

#Install likewise-open in Ubuntu Hardy
sudo aptitude install likewise-open-gui

sudo domainjoin-cli join anjani.com.np Administrator

sudo update-rc.d likewise-open defaults

sudo /etc/init.d/likewise-open start

#Remove from the windows Domain

The domainjoin-cli utility can also be used to remove from the domain.

sudo domainjoin-cli leave


#Allow Active Directory Domain Administrators to Administer Ubuntu

This will allow members of the Domain Admins AD group to issue sudo commands. From a command prompt

sudo visudo

Add this line to the resulting file

%YOURDOMAINNAME\\domain^admins ALL=(ALL) ALL

#ADD AD Group to sudoers list

%YOURDOMAINNAME\\groupname ALL=(ALL) ALL


#how to add user to sudoers list?
adduser

adduser anjani sudo

Check Disk Space Usage on Ubuntu


#df-h

Bash Shell Command to Find or Get IP address

$ /sbin/ifconfig



How to turn off, restart, and shut down Linux.
Answer

Shutting down / rebooting the computer from the shell / command line

Below is a listing of each of the commands that will enable a user to shut down, turn off, reboot, etc. their Linux computer from the command line. Users can find additional information about each of the commands by clicking the link.

halt
poweroff
reboot
shutdown

To list the users:


cat /etc/passwd | cut -d":" -f1

How to remove non-empty dir
ectory?

rm -rf epoints

No comments:

Post a Comment