Jump to content

Recommended Posts

Posted

Just want to get access to a folder that has permissions for root only.

 

I don’t want to mess with this server too much. But need to look at a few config files.

Posted (edited)

I don't know the context as it's a little bit vague. Does the directory / files need to be root owned? There are many options depending on what the files are and what you are wanting to achieve.

 

1- Change the directory / files owner (chown)

2- Create a group or use an existing group, add the user to that group and change the group ownership and permissions of the files/directories.

 

The above options will require root/sudo to make the initial changes. If you can give more details i.e. what the files are for as you don't want to be changing permissions and groups unless required as it could mess up other things. More info and we should be able to give more relevant solutions.

Edited by ComplexsysDan
Posted

Use "sudo su" or "sudo su -"

 

Difference is explained below.

 

sudo su Bash is called as interactive non-login shell. So bash only executes .bashrc. You can see that after switching to root you are still in the same directory:

user@host:~$ sudo su

root@host:/home/user#

 

 

sudo su - This time it is a login shell, so /etc/profile, .profile and .bashrc are executed and you will find yourself in root's home directory with root's environment.

  • 2 months later...
Posted
Is there a way i can allow the current user root access?

 

(not for terminal as i know i can run the Sudo cmd)

 

You mean in a graphical environment? If your other aim is to make no changes, these two are not compatible and running a desktop as root is dangerous enough anyway. sudo in a prompt is a much safer alternative.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...