How to access the terminal through live cd when the grub is locked?

What does a locked grub boot loader have to do with using the terminal? If you boot from a live CD/DVD/USB drive and login, you will get a GUI desktop. From that, the terminal program should be available either as an icon on the top menu bar, or as a command in one of the application menus, such as "System Tools" or "Accessories".

If you can't get to grub, then you can't boot in terminal or start a terminal because the operating system has not started yet. The bootloader is the small program that executes in order to start the operating system. If that program cannot start the operating system, then there is no terminal to access.

So, if you can't make it up to the grub menu, then there is nothing you can do. Your copy of the CD or USB device must not have been setup correctly, or your computer couldn't boot it for some reason, etc.

If you can make it to the grub menu but attempting to boot the operating system fails, then you have two choices.

Most of the time (depending on your distro), there is a "recovery" or "terminal mode" or "fail safe mode" for booting the operating system. Most of the time, that boot mode will be a terminal-only boot of the operating system (i.e. it won't start the desktop manager and X server, and all that, only a basic terminal windows will appear). If that cannot boot, and it is a liveCD, I would consider changing to another Linux distribution, because not being able to boot even in recovery mode is really bad, it probably means the distro / kernel is deeply incompatible with your computer (which would be very surprising).

The other choice is to launch the Grub command-line environment. This is an expert-level thing that you probably don't really want to delve into, but it allows you to configure the booting of the operating system manually with commands, eventually leading to an attempt to boot an operating system somehow.

If you can make it to grub and you can boot the operating system up to some point between total darkness to login menu, but for some reason you can't make it to the end goal (having the OS booted up and displaying the desktop), then you might consider switching to a terminal login instead. This is dependent on the distro, but under Ubuntu (and its family) you simply hit CTRL + ALT + F1 and that gets you to a terminal window with no X server or desktop manager, you can login and do whatever you want. This trick is also useful if your desktop manager or X server crashes (rarely happens, but sometimes it does) because those CTRL + ALT + F1 to F6 are all available bare terminal accesses to the OS, which you can use to recover without having to restart (or you can use it to tell it to restart (with reboot or shutdown). Other distros might have other key combinations for this, but that's for you to look up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.