Along this Debian class we will deal with the following. Debian file system, superuser, editing text files, executing commands in the shell, configuring, installing and uninstalling packages.
This post is part of a bigger Debian material that you can access here.
Debian File system, users and superusers; Introduction.
Debian GNU Linux uses the superuser paradigm. In computing, “the superuser is a special user account used for system administration. Depending on the operating system, the actual name of this account might be: root, administrator, admin or supervisor. In some cases the actual name is not significant, rather an authorization flag in the user’s profile determines if administrative functions can be performed. In operating systems which have the concept of a superuser, it is generally recommended that most application work be done using an ordinary account which does not have the ability to make system-wide changes.”
Debian Linux is of course a system with the superuser paradigm, by default the superuser name is root. But root might refer also to other parts of the system. Root is where every thing starts in Linux systems is like the alpha of the system. Is the “father
ls -la /
Now it will prompt you for the root password and after you introduce it correctly it will change to the root user. Or if you want to change to a specific user you can use su, followed by the user name.
To know the user you are in you can use the who am I command again.
[email protected]:~$ whoami abel [email protected]:~$ su Password: [email protected]:/home/abel# whoami root [email protected]:/home/abel# su abel [email protected]:~$ whoami abel [email protected]:~$
The linux systems and Debian as one of them works like a cage for users. If you are abel and you execute su, then you login to root. But the session for abel does not end. After you execute su and change to root you can go back to your old session. To do that you just have to execute the command “exit” and it will take you back to the old user.
Before we continue with other content related to the file system and the super user. Let me introduce a few other commands and concepts.
System restart and shutdown; init run levels-command
- init 0 – Shootsdown the computer. DEPRECATED in favour of “shutdown -h”
- init 6 – Reboots the system.DEPRECATED in favour of shutdown e.g.: “shutdown -r +1”
- What are the init run levels?
- There are other init run levels from 1 to 5. What do they do?
Command to view current the network configuration; ifconfig.
“The ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.”
Taken from ifconfig Debian official manual (man ifconfig)
Tor now we will use it just to view the network interface to view the interfaces configuration you just have to insert the command as root.
[email protected]:/home/abel# ifconfig eth0 Link encap:Ethernet HWaddr 70:71:bc:b9:34:ad inet addr:10.175.0.146 Bcast:10.175.1.255 Mask:255.255.254.0 inet6 addr: fe80::7271:bcff:feb9:34ad/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:29874506 errors:0 dropped:0 overruns:0 frame:0 TX packets:1161761 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:5595877026 (5.2 GiB) TX bytes:213607775 (203.7 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:333529 errors:0 dropped:0 overruns:0 frame:0 TX packets:333529 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:123740836 (118.0 MiB) TX bytes:123740836 (118.0 MiB) [email protected]:/home/abel#
Feel free to research about this very useful command.
Remote connections using ssh protocol.
[email protected]'s password:
Linux khs01sw10 2.6.325amd64 #1 SMP Mon Sep 23
22:14:43 UTC 2013 x86_64
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to
permitted by applicable law.
Last login: Mon Feb 17 15:50:11 2014 from 10.175.0.167
Organization of the root directory and HDDs in Linux.
This classes. Please feel free to user the ls command and also the CD command from class 1 to understand this structure.
- /etc – Configuration files for most of the
- softwares eg: ssh, network, dhcp, etc.
- /home – users folder exept for the root user
- eg: class, abel, pedro, miguel, etc.
- /var -variable data eg: databases, caches,
And secondly we will also work with:
- /media- Is the mounting point for removable media.
- /mnt- mounting point for temporary mounted file systems.
- /boot- boot loader static files.
- /bin – essential user command binaries
Also we will work with the root user’s folder. So I will leave a homework, for you to research about it.
- Where is the root user folder?
Now to continue with the class lets first learn hot to edit with nano.
Editing files with nano.
- To edit a file: $ nano /path/to/file.\
Nano internal commands:
CTRL + x: closes the file.
CTRL + o: saves.
CTRL + c: cursor position.
CTRL + k: cuts from nano.
CTRL + y: paste to nano from nano
- CTRL + C cancels the current action if it’s not finished or says information about the cursor’s position.
“Commmonly refers to a storage location, often for safety or preservation. Many software publishers and other organizations
Debian Package Management
- aptitude install ssh
- aptitude install mc
- aptitude update
- aptitude install
- aptitude upgrade