0

I am wondering is there anyway to open terminal always with sudo privileges. And is there a way to open specific file with sudo privileges like windows have "run as administrator".

imposter
  • 458
  • 1
  • 7
  • 22

1 Answers1

3

To always open a terminal as root is not a good idea, but, hey, it is your computer and we hope you will act responsibly.

Edit your .bashrc file and add sudo -i to the end. Then, anytime you launch the terminal, it will always start with the prompt for the [sudo] password, and drop you to a prompt with root privileges when you successfully entered the password.

With respect to opening a specific file, there is an extension for the file manager Files (aka nautilus) that allows to open a new file manager window, or edit a file with root privileges. It is available in the package nautilus-admin.

vanadium
  • 88,010
  • 3
    Why was this downvoted? It's a perfectly valid answer to the question. Is it a security concern? Maybe, but not more than typing sudo -i as soon as you enter your terminal. Is this a bias because someone thinks they know better how a particular user should use their own system? – Artur Meinild Jun 24 '21 at 19:48