11/18/2013

Automatically starting X with GDM in Backtrack

ကြ်န္ေတာ္တုိ႔ Backtrack5 မွာ Boot တက္လုိက္ရင္ အျခား Windows, Ubuntu တုိ႔လုိ username, password ရုိက္ေပးရမယ့္ Login Screen ကုိတန္းမေရာက္ဘူးဗ်။ အဲဒီအစား Command line ကေန usernae, password ကုိရုိက္ေပးရတယ္။ ျပီးတာေတာင္ startx လုိ႔ရုိက္ေပးရေသးတယ္။ ကြ်န္ေတာ္အစကမသိလုိ႔ အင္စေတာ့လုပ္ျပီးတာေတာင္ ဘယ္နားကေနဝင္ရမွန္းမသိလုိ႔ ေတာ္ေတာ္တုိင္ပတ္ဖူးတယ္။ ေလထွာ။ :D အခု Tool ေလးကုိအသုံးျပဳျပီး သူမ်ား OS ေတြလုိ password ရုိက္ရမယ့္ေနရာမွာ လူလုိသူလုိျဖစ္ေအာင္ ေျပာင္းၾကည့္မယ္ဗ်ာ။ :P

အရင္ဆုံး Terminal ကေန apt-install gdm လုိ႔ရုိက္လုိက္ပါ။ ဒါဆုိ သူ႕ဟာသူဆက္လုပ္သြားပါလိမ့္မယ္။ သိပ္မၾကာပါဘူး။ Done ဆုိျပီးေပၚလာရင္ ေတာ္ေတာ္ဟုတ္ေနပါျပီ။ 
အုိခီ ျပီးရင္ အလုပ္ျဖစ္မျဖစ္ Terminal မွာ gdm ဆုိျပီးရုိက္ၾကည့္လုိက္ပါ။ ေအာင္ျမင္တယ္ဆုိရင္ Logon Screen ကုိျပေပးပါလိမ့္မယ္။ ေနာက္ Terminal ကေန nano /etc/init/gdm.conf ဆုိျပီးသြားရင္လည္းရတယ္။ ဒါမွမဟုတ္ Computer>File System>etc>init>gdm.conf ဆီကုိသြားျပီး အဲဒီ gdm.conf ဖုိင္ကုိဖြင့္လုိက္ပါ။ ဒါဆုိရင္ အထဲမွာ config ဖုိင္ကုိေတြ႔ရပါမယ္။ မူလအတုိင္းဆုိရင္ ေအာက္ကအတုိင္းျဖစ္ပါလိမ့္မယ္။

# gdm - GNOME Display Manager
#
# The display manager service manages the X servers running on the
# system, providing login and auto-login services

description "GNOME Display Manager"
author "William Jon McCann <mccann@jhu.edu>"

start on (filesystem
and started dbus
and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
or stopped udevtrigger))
stop on runlevel [016]

emits starting-dm

env XORGCONFIG=/etc/X11/xorg.conf

script
if [ -n "$UPSTART_EVENTS" ]
then
[ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/gdm" ] || { stop; exit 0; }

# Check kernel command-line for inhibitors
for ARG in $(cat /proc/cmdline)
do
case "${ARG}" in
text|-s|s|S|single)
plymouth quit || : # We have the ball here
exit 0
;;
esac
done
fi

if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
elif [ -r /etc/environment ]; then
. /etc/environment
export LANG LANGUAGE
fi
export XORGCONFIG

exec gdm-binary $CONFIG_FILE
end script

အဲဒီမွာ အနီနဲ႕ျပထားတဲ့ code line ေတြကုိဖ်က္ေပးရပါတယ္။ ျပီးရင္ Save ေပါ့ဗ်ာ။ ဒါဆုိရင္ ေအာက္ပါအတုိင္းျဖစ္သြားပါမယ္။

# gdm - GNOME Display Manager
#
# The display manager service manages the X servers running on the
# system, providing login and auto-login services

description "GNOME Display Manager"
author "William Jon McCann <mccann@jhu.edu>"

start on (filesystem
and started dbus
and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
or stopped udevtrigger))
stop on runlevel [016]

emits starting-dm

env XORGCONFIG=/etc/X11/xorg.conf

script
export XORGCONFIG

exec gdm-binary $CONFIG_FILE
end script
 
အုိခီ ျပီးရင္ BT ကုိ reboot လုပ္ေပးလုိက္ေပါ့ေနာ္။ Terminal ကေန reboot ဆုိရင္ရပါျပီ။ :D ဒါဆုိရင္ Boot တက္လာတာနဲ႔ ေအာက္ကလုိ ေတြ႕ရပါမယ္။ 
 
Warning: တစ္ခုခုမွားလုပ္မိရင္ Login ဝင္မရတာမ်ဳိးျဖစ္တတ္ပါတယ္။ အာ့ေၾကာင့္ ဒီနည္းကုိစမ္းမယ္ဆုိ account အသစ္တစ္ခုလုပ္ျပီးမွစမ္းပါ။ Code:
useradd -m -g users -G admin,video,disk,games,cdrom -s /bin/bash test_user 
ေနာက္ စမ္းမယ့္ gdm.conf ဖုိင္ကုိလည္း Backup လုပ္ထားပါ။ Code:
cp /etc/init/gdm.conf /etc/init/gdm.conf.backup
 
 

1 comment:

If you good, i don't bad. if you think you can bark me, I think i can also fuck you. I'm just ordinary person. Is that OK? :)