That would be the chroot command. Usually when this is used one mounts the pseudo filesystems (/dev /sys /proc) and then explicitly invoke the shell they want to use in the new root environment, like so:
# chroot /mnt/debian /bin/bash
There are other options, refer to the chroot man page. What this command does is tells the current session that / should now be at /mnt/debian and to invoke /bin/bash as soon as the root is set up.
Changing root is primarily used in two ways. One is to effectively set up a rescue environment for Linux from live media so you can use the tools of the target system and not the host system to do your work (Pretty much essential for adjusting kernel stuff/installing bootloaders correctly, the other is actually fakeroot: It's how most Linux package management systems actually work, by creating a fake root tree so that packages have a tree that exactly duplicates the location the files would be in when installed. This way the package manager simply has to extract the file to / to install the files precicely where they need to go. (Most package management has a little more complexity than this, but this is how package managers work in terms of the actual file management.)
Your login shell can be changed by using the chsh or ypchsh command.
You can obtain root permissions in Linux by using the "sudo" command before executing a command that requires elevated privileges. This allows you to temporarily act as the root user to perform administrative tasks. Alternatively, you can switch to the root user using the "su" command by entering the root user's password.
switch user = su $ su above command will change the user to root $su johndoe above command will change the user to johndoe
There is no command specific to SSH. Whether you are physically using the machine in question or using an SSH client the process is the same. On Ubuntu, one is encouraged not to use the root account directly. To execute a command as root, enter sudo . On distros that don't include sudo, you can gain a root shell by entering the command su root. Both commands will require you to enter either your admin password or the root password, respectively.
If by simulate you mean to run command as root i.e with root privileges then sudo is the command. sudo <command name> which execute the command with root privileges.
Enter this command as root: "apachectl start"
You don't need a shell script for this; just use the 'id' command look at the uid, which for root is 0.
If you want everything, start at the root directory and issue the command: ls -R
CD /
This will depend on the distribution. Most Linux distributions allow you to assume root by simply entering "su", followed by your password. Ubuntu-based distributions disable the root account by default, and you are expected to use the "sudo" command before any command that requires root privileges (ie. sudo rm -rf /). You can gain a root shell by entering "sudo su", followed by your password.
No, none of the passwords used in a Linux system can be "recovered" because there isn't a reverse encryption for it. However, you can "reset" the root password by using the single-user mode at boot time (which puts you in the root account automatically) and then changing at that time.
Linuxchmod: change permission bits (only the owner and root are allowed to do this)chown: change owner and group (only root is allowed to change owner, group may be changed by owner)chgrp: change group (only the owner and root are allowed to do this)