Can a grub password be changed ?

10 respostas [Última entrada]
amenex
Desconectado
Joined: 01/03/2015

I like the fact that grub wants a password. Makes me think twice about which OS I'm booting into; like "Are you sure ?" in another infamous OS.

After installing several old hard drives into usb-connected cases as well as setting up several desktop PC's, I'm faced with a long list of grub passwords which get mixed up in my head. Life would be so much simpler if I simply changed all those different grub passwords into a simple common password.

I know that I can get rid of grub's password requirement my deleting or commenting out the "echo password grub #####" line in /etc.grub.d/01_PASSWORD file, but does that line link to another place in the OS that has to match ##### ?

davidnotcoulthard (non verificado)
davidnotcoulthard

I don't think so - GRUB doesn't really control anything in the OS (actually it's controlled by the OS - it simply releases all control once an OS starts to boot).

EDIT: Actually what I meant to say was YES you can change it but no it won't affect anything in the actual OS.

lembas
Desconectado
Joined: 05/13/2010

Sure go ahead and change it.

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

Just edit the password with 'sudo gedit /etc/grub.d/01_PASSWORD' (you can choose your favorite text editor instead of gedit). After saving the file, execute 'sudo update-grub' for the change to be effective.

lembas
Desconectado
Joined: 05/13/2010

> sudo gedit

It's best to categorically use gksudo for graphical apps and reserve sudo for cli only. We've seen many a people here having issues because of messed up permissions.

(yes, some graphical apps will work just fine with sudo but it's a bit of a russian roulette)

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

My mistake. I actually know that.

SuperTramp83

I am a translator!

Desconectado
Joined: 10/31/2014

I have been using only sudo for all the graphical applications on many distros and I have never ever had a single issue..

amenex
Desconectado
Joined: 01/03/2015

Followup: I followed Magic Banana's straightforward instructions and yes, One can change grub's password, but yagotta remember to run sudo update-grub[2] for the change to take effect. Note: [2]: My 01_PASSWORD file says to run [sudo] update-grub2. I think that elsewhere it came out that it doesn't make any difference because Trisquel knows what we mean ...

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

/usr/sbin/update-grub2 is a symbolic link to /usr/sbin/update-grub:
$ ls -l /usr/sbin/update-grub2
lrwxrwxrwx 1 root root 11 nov. 12 09:40 /usr/sbin/update-grub2 -> update-grub

johnsmith
Desconectado
Joined: 11/26/2015

informative post for me .

amenex
Desconectado
Joined: 01/03/2015

I went ahead and made a common grub password for various PC's that I'm keeping up to date.

Bear in mind that the "sudo update-grub2" writes grub's data onto the "master boot record" (or the trisquel equivalent) of the hard drive that's in use when you execute the command. I had to pay attention to that with the two external USB-connected hard drives that I'm using with my Lenovo T420 notebook. On my Micro Center Power Spec dual-boot Ubuntu/Tisquel 7 desktop, updating the grub password with Trisquel (the second OS) also made the same grub password work to start Ubuntu.

That said, if you disconnect the USB-connected external hard drives on my laptop, there's yet another grub installation to be "set" on the internal hard drive.