Linux administration

Linux is a multi-user UNIX-like operation system, which username of administrator user with complete system control is called 'root' user, which is as same as UNIX.
Linux system can be administrated commonly through:

  • virtual consoles by pressing Alt-F1 to Alt-F6 for six different virtual consoles in front of the server machine.
  • secure shell (ssh) over internet or private TCP/IP network.

Assumption on following examples:

  • IP address of Linux Server to be connected is 192.168.100.1.

Virtual Consoles
login: prompt will be shown at each virtual consoles when user is not logined. You can enter 'root' (or a username of other normal users) at the prompt, and then password: prompt will be shown to ask for your password.
On successful login, a command prompt of your defaul command shell is shown.
sfung@linuxharbour:~$
You can now administrate with Linux and shell commands, running programs, and do other adminstration work.
When you completed your administration process and leave the system, you should type 'exit' or 'logout' to logout your user account, and login: prompt will be shown again after logout.
Secure Shell
On Windows system, you should download a free SSH/Telnet client called 'putty', you can google 'putty'. And then after installation (if needed) and run it, you can input the IP address (eg. 192.168.100.1) and select SSH protocol to connect to SSH server. Next, you can login as usual as at virtual consoles.
On Linux system with OpenSSH client, you can type the following command to connect to SSH server.
$ ssh root@192.168.100.1

  • Some Linux system will deny 'root' login through SSH, so you should login as normal user first through SSH, and run 'su' or 'sudo' commands to  yourself to "super user" (ie. root).

if SSH TCP port of SSH server is moved to a customised TCP port (eg. 2222) from default port 22:
$ ssh -p 2222 root@192.168.100.1
To copy a file (eg. file1.php) to server from local through SSH, you can use "scp" command.
$ scp file1.php root@192.168.100.1:
Super User with su or sudo
When you logoned the Linux system with a normal user account, you can use 'su' to change your user identify to adminstrator, or use 'sudo' to run a Linux command as administrator.
$ su -
After you typed above 'su' command, a password prompt is shown for root password. You will be changed to 'root' user if you inputted the correct root password.
'sudo' program can let specified user(s) to run a program/command as root user. To allow a user (eg. username is 'sfung') to use sudo, you should add the following line at /etc/sudoers file with 'visudo' program. 'visudo' program can be only executed by 'root'.
sfung  ALL=(ALL)  ALL
And after saving the file, allowed sudoers (users who is allowed to use 'sudo') can execute any program/command as root user with 'sudo'.
$ sudo ls /root
[sudo] password for sfung:
As above, sudo password for a user might be asked, you should input the password of prompted normal user (sfung's password in this case).