Changing Ownership

Changing ownership of files and directories is done using the CHOWN command.

Example:
$ chown -R www-data:www-data sample

- R applies the change recursively
www-data:www-data is the user and group
sample is the target file or directory

Deleting Users

Deleting users is done using the USERDEL command.

Example:
$ sudo userdel -r -f username

-r = remove home directory
-f = force removal of files

Adding Users

Adding users to your system is done using the USERADD command.

Example:

$ sudo useradd -d /home/username -m username -p password -s /bin/false

- d  = home directory of the new user
- m = create a home
- p = provide a password
- s = the login shell of the new user

-d and -m are used in conjunction.
You can assign /bin/bash for bash or /bin/false for no shell access.
You can change passwords later using $sudo passwd username.

Display CPU Information

To display the CPU information, type from the terminal:

# cat /proc/cpuinfo

Upgrade Ubuntu Server

Upgrading the Ubuntu Server, e.g. from version 8.04 to 8.10:

Step 1. Make sure your current distribution is up-to-date.

  1. # sudo aptitude update
  2. # sudo aptitude upgrade
  3. # sudo aptitude dist-upgrade

Step 2. Perform the upgrade!

  1. sudo aptitude install update-manager-core
  2. sudo do-release-upgrade

Display Ubuntu Version

To display the current Ubuntu version, issue this command from the terminal:

#lsb_release -a

Change IP Address

To change IP address, you’ll need to edit /etc/network/interfaces
#sudo vi /etc/network/interfaces

[Read more...]

Setup Admin Password

#sudo passwd root
#su

Secure MySQL

The default configuration has “root” with no password. The following shows you how to lock down MySQL by assigning a password to root and creating a super user with all privileges for administration use.

#sudo mysql -u root -p

[Read more...]

Install phpMyAdmin

#sudo apt-get install phpmyadmin