How do I recover login after installing xdm?

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

How do I recover login after installing xdm?

Postby lucky7456969 » 10 Oct 2012, 04:00

I can't login to FreeBSD after installing xdm. I used 'root' as the user when I changed ttys
file. As I log back in using single user mode, there is no text editor that I can use to change it back to its normal condition.
How to make myself loginable to the system again?
Thanks
Jack
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby SirDice » 10 Oct 2012, 06:23

Boot to single user mode then:
Code: Select all
fsck -y
mount -u /
mount -a -t ufs
swapon -a

After that the editors should be available and you should be able to edit [file]/etc/ttys[/file].
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16195
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby lucky7456969 » 10 Oct 2012, 06:39

Thanks Expert SirDice, it is okay now.
But how do I avoid login failure after installing xdm, is the 'root' account the key?
Thanks
Jack
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby SirDice » 10 Oct 2012, 06:43

Try logging in with a 'regular' user account. See if that works. But I don't think XDM prevents root from logging in, not recommended but it should work.

Did you perhaps install [port]x11/xorg-minimal[/port] instead of [port]x11/xorg[/port]? The latter contains the default window manager TWM. If it's not installed you will have to install an alternative and make sure it's started from your [file]~/.xinitrc[/file] (or was it [file]~/.xsession[/file], symlink the two to make sure).
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16195
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby lucky7456969 » 10 Oct 2012, 07:15

SirDice wrote:Try logging in with a 'regular' user account. See if that works. But I don't think XDM prevents root from logging in, not recommended but it should work.

Did you perhaps install [port]x11/xorg-minimal[/port] instead of [port]x11/xorg[/port? The latter contains the default window manager TWM. If it's not installed you will have to install an alternative and make sure it's started from your [file]~/.xinitrc[/file] (or was it [file]~/.xsession[/file], symlink the two to make sure).


Permission changed 777 to ttys
Login as other user
Change the file
Can't login still.
Image
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby SirDice » 10 Oct 2012, 08:11

lucky7456969 wrote:Permission changed 777 to ttys

Don't ever do that again!
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16195
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby lucky7456969 » 10 Oct 2012, 08:50

When I turn on xdm, I am still unable to login.
Either by "regular" user or "root"
Any further advices?
Thanks
Jack
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby adamk » 10 Oct 2012, 09:20

Explain what you mean by "unable to login." Does the graphical login screen not come up? Does X work if you don't use xdm?
adamk
Senior Member
 
Posts: 1624
Joined: 21 Nov 2008, 11:00

Postby lucky7456969 » 10 Oct 2012, 10:45

adamk wrote:Explain what you mean by "unable to login." Does the graphical login screen not come up? Does X work if you don't use xdm?


When I type the user name on the graphical login screen and password, it says the username/password is not correct. When I change it back (tyvs, off xdm), I can login thru the text login prompt.
Thanks
Jack
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby SirDice » 10 Oct 2012, 11:31

Do you have a different keyboard layout? It might have reverted back to a US layout.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16195
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby lucky7456969 » 11 Oct 2012, 04:38

Dear SirDice,
I have the default keyboard layout, as far as I recall, I did not change anything when I installed the system.
Thanks
Jack
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby gpw928 » 12 Oct 2012, 02:48

Hi Jack,

The login process is handled by xdm. So try restarting xdm, and login via X as a normal user. If that fails, log back in as root via the console and tell us what the following show.

Run this:
Code: Select all
grep "xdm:" /var/log/messages


Then look in:
  1. [FILE]/var/log/xdm.log[/FILE]; and
  2. [FILE]$HOME/.xsession-errors[/FILE] for that user
for any error messages indicating any reason for a login error.

If that provides no leads, we would expect this to show no differences:
Code: Select all
diff /usr/local/share/examples/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config


Finally, it may help for us to see the output of the following:
Code: Select all
ls -laR /usr/local/lib/X11/xdm


Cheers,
It's all just 1's and 0's. You just have to get them in the right order.
gpw928
Junior Member
 
Posts: 69
Joined: 13 May 2010, 01:09
Location: Australia (rural NSW)

Postby lucky7456969 » 24 Oct 2012, 05:31

I start commenting out the Xconsole line of the Xsetup_0 file.
It works for "root" and it doesn't work for other accounts. (can't login)
And The system becomes very unstable
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby fluca1978 » 24 Oct 2012, 06:48

If works for root than it is probably a permission problem, even if it is still not clear to me what the problem is. You cannot login as normal user into the console (text-mode), into the display manager, or what? Please provide also the logs information as suggested in a previous post.
fluca1978
Member
 
Posts: 726
Joined: 20 May 2010, 08:53

Postby lucky7456969 » 24 Oct 2012, 08:53

Here is the xdm.log
I don't have an .xsession-errors file in my $HOME/ directory
This is just the root one
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby SirDice » 24 Oct 2012, 09:14

Code: Select all
xdm info (pid 1524): sourcing /usr/local/lib/X11/xdm/Xsetup_0
/usr/local/lib/X11/xdm/Xsetup_0: !#/usr/local/bin/bash: not found


Install [port]shells/bash[/port]. If it's installed open that file, the first line should begin with '#!' not '!#'.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16195
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby lucky7456969 » 24 Oct 2012, 09:24

I've got his however. This is the returned message after I typed in the login name and password
Attachments
login_fail.png
login_fail.png (17.46 KiB) Viewed 121 times
lucky7456969
Junior Member
 
Posts: 39
Joined: 10 Sep 2012, 08:56

Postby gpw928 » 25 Oct 2012, 02:03

Hi Jack,

As SirDice points out, the xdm log shows a serious error in the file [FILE]/usr/local/lib/X11/xdm/Xsetup_0[/FILE]. You must correct this (but see below).

The logs you posted suggest to me that there's been a fair bit of hackery to the standard X11 setup. I can't see what version of FreeBSD you are running, but it seems odd to me that Xsetup_0 is running a bash script (I would expect [FILE]/bin/sh[/FILE]).

Mine (which is admittedly old) looks like this, and unless you have a good reason, yours probably should too:
Code: Select all
#!/bin/sh
# $Xorg: Xsetup_0,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail


Also the diff you sent of [FILE]xdm-config[/FILE] shows "DisplayManager*authorize" has been set "false". I would expect this to be "true" on a clean system. The default xdm-comfig is a really good place to start. So unless you know better, you should (as root):

Code: Select all
cp -p /usr/local/lib/X11/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config.bad
cp /usr/local/share/examples/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config

While we are here, you should check that rest of the files in [FILE]/usr/local/lib/X11/xdm[/FILE] for modifications. Investigate anything you find with this:
Code: Select all
cd /usr/local/share/examples/xdm/
for f in *
do
  echo "=== $f"
  diff $f /usr/local/lib/X11/xdm/$f
done


Cheers,
It's all just 1's and 0's. You just have to get them in the right order.
gpw928
Junior Member
 
Posts: 69
Joined: 13 May 2010, 01:09
Location: Australia (rural NSW)


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests