answersLogoWhite

0

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.)

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

How do you change the root shell in unix?

Your login shell can be changed by using the chsh or ypchsh command.


How do you obtain root permissions in Linux?

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.


What does the letters su stand for in a command?

switch user = su $ su above command will change the user to root $su johndoe above command will change the user to johndoe


What is the command to obtain root permission in Linux for SSH?

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.


How do you simulate a command as root?

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.


How do you execute an Apache program in Linux?

Enter this command as root: "apachectl start"


Could you tell me how to write a script that verify that I am the root user in Linux?

You don't need a shell script for this; just use the 'id' command look at the uid, which for root is 0.


Write command to show all files and directories?

If you want everything, start at the root directory and issue the command: ls -R


What is the command that will change the current default directory to the root directory in Unix?

CD /


What command must an ordinary user type into a terminal window in order to become root?

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.


Can you recover a root password in Linux?

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.


What is the command used to change the file access permission?

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)