No, you can't and I will try to explain you why. There are two things that prevents you to login to tty as guest:
The default shell for guest accounts is set to /bin/false
. You can check this with the following command (the shell is set on the last field on each line):
grep guest /etc/passwd
/bin/false
is just a binary that immediately exits, returning false, when its called, so when someone who has false as shell logs in, they're immediately logged out when false exits.
The password for any guest account is disabled by default and this is absolutely normally: if you invite someone in your house, you don't give him your house keys.
Because of this nobody can't login normally[1] in any interactive login[2] shell. You can check this with the following command (the password is set on the second field on each line):
grep guest /etc/shadow
[1] I said normally, because you can switch from a real user to a user with the password disabled using sudo su user_with_no_passwd
(like in real life: when someone knocks on your door, you open him with your keys).
[2] tty1-6 wast (and I suppose it will be) all the time an interactive login shell. And this world - login - it suggest me that I must to have a password to get over it (like in real life: when you see a lock, you need a key to open it).
Now, if you still want to login to tty as guest, follow the instructions from the below ttyrecord image:
And now you can go in tty and login as guest... a guest with password... which means that it is not anymore a guest...
I have an open PAM-related question right now, so I can say from experience that modifying any PAM modules can quickly get very specific to the version of Ubuntu you are working with. What works for Precise, may not always work for Quantal, etc.
That said, the answer to your question probably does not require any changes to PAM modules. In fact, you almost have it.
Add this line to the bottom of /etc/lightdm/lightdm.conf
greeter-allow-guest=false
My lightdm.conf
looks like this:
[SeatDefaults]<br>
greeter-session=unity-greeter<br>
user-session=ubuntu<br>
greeter-allow-guest=false<br>
Now restart your machine.
On 12.10, I tested that this removes Guest from the user menu, but leaves it as a manual option once logged in on another account.
Pretty sure this will work for you on 12.04 as well.
Best Answer
First,
It might be to your advantage to find how the guest account is to be used.
Some important points are:
According to the outdated documentation for Guest user accounts for Ubuntu: 'A guest account allows visitors to use the computer system without login credentials.' So the whole point of the user is to have no password.
Ask far as I know, the guest account purges documents or files written into its home directory (which is actually in /tmp) after the session is terminated. This is shown in this comment by @andol.
Taking these things into accounts, primarily, the guest account should be used for:
So, now I think you can see that the Guest Account should not be used as a legitimate account for your computer, but like a Library or public computer: unless you have a USB or similar, you're files are as good as gone. Therefore, you should have no need to password-protect the guest account at all.
What should you do?
If I were you I would make a whole new account, depending on your intentions. If you were looking for an account that wouldn't show your files but could still be used by others (like a young sister) I would just create a new account.
Additionally, you could also make your own Guest Account and disable the one that came with Ubuntu 12.04 and later.
You can do this by following the steps on the Technology Windows & Linux website.
Alternatively, in theory, you could use the
passwd
command. I haven't tried this before, so its just a guess: but you would type eithersudo passwd guest
orpasswd guest
. It may not work, and I don't think it's a great idea because of the reasons I have listed above.Good luck!