PDA

View Full Version : Graphical root login-- be fore warned im a total noob --



LT72884
11-02-2006, 06:54 PM
hello all. im brand new at this whole linux thing. im barely 22 years old and i am gettin ready for school. i am goin to be taking linux fundimentals and cyber security. my question is i installed knoppix 5.0.1 onto my box and i want to log into the graphical mode using root. for some reason i get an error message saying knoppix wont allow this action. why and how do i fix that. the reason i want to log in graphicaly is becasue i want to learn hwo to do administration and root actions graphicaly and in the text consoule. im wierd that way. i prefere gui's over text modes. i use windows alot and love the way its set up with the admin. i am having a hard time understanding why most peopl do root or admin actions in text mode. alsoi where can i larn basic stuff for linux. i am currently trying to build a LFS system but half the commands in there i dont understand and the whole mount thing,WTF is that about. I have downloaded a book form the TLDP site and even though the book is labled linux for beginers, it clearly is not becasue i have no clue what he is talking about in there. lol. I DO NOT understand how networking worx with this OS at ALL. where is my network nieboorhood icon so i can see who is on the network.

PLZZZZZ HELP ME. I feel like im in a oblivian of confusion.

thanx sooo much for lettin me speak my mind. but i realy want to learn this stuff and learn it well.

OErjan
11-02-2006, 10:07 PM
the fact is that most configurations is just textfiles, that you can do in any way you like, they are usualy fairly informative.
below i have posted a piece from xorg.conf (the windowslike environment in many distributions), the parts with a # infront are notthing more than information for the user the lines without are the different setings.
# ************************************************** ********************
# ServerLayout sections.
# ************************************************** ********************

# Any number of ServerLayout sections may be present. Each describes
# the way multiple screens are organised. A specific ServerLayout
# section may be specified from the X server command line with the
# "-layout" option. In the absence of this, the first section is used.
# When now ServerLayout section is present, the first Screen section
# is used alone.

Section "ServerLayout"

# The Identifier line must be present
Identifier "Simple Layout"

# Each Screen line specifies a Screen section name, and optionally
# the relative position of other screens. The four names after
# primary screen name are the screens to the top, bottom, left and right
# of the primary screen. In this example, screen 2 is located to the
# right of screen 1.

Screen "Screen 1"

# Each InputDevice line specifies an InputDevice section name and
# optionally some options to specify the way the device is to be
# used. Those options include "CorePointer", "CoreKeyboard" and
# "SendCoreEvents".

InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"

EndSection


you can do any root task in knoppix by typing
sudo infront of the command in a console or "run command" under the "k" menu (START menu in win), say sudo konqueror, that will open konqueror, more or less same thing as explorer combined with "this computer", in administrator mode.
"sudo kedit", will open something very like notepad where you can open text files and edit them.
or you can click the icon kontrol center in the "k" menu and get most things graphically.
or type sudo kcontrol in a terminal (console, xterm or whatever you want to call it) or run program in the run command on the K menu...

as for the mounting, this is more or less necesary in linux, for a desktop or laptop it may be overkill but in a server or multiuser system this allows the admin to hotswap disks or change the path to partitions/disks as he/she wishes, and as linux and unix was made for that to begin with...it is one of many things that will get clear after a while.
you can use mount to create virual drives (just a file given a filesystem and mounted) or mount ISO's of cd and DVD's, or mount harddrives over a network...

if you want to get a "crashcource" in textmode linux i can recommend
http://floppix.com/labs.html
there you get a consise description on many common processes, usually enough to stumble trough most tasks in textmode linux.

as for network neighbourhood, try the penguin icon then utilities then samba network neighbourhood, that should help you get that sorted, if not keep asking.

to get faster/better help, you put your specific problem in the subject, same thing if you try posting in correct part of forum, most will try to help you, peraps some harsh language sometimes but try to be patient with us all, many may find things hard to explain as they are so "simple" for the one explaining...
in other words, if explanation is not good enough, ask again specifying parts you have trouble with.
keep asking we will try to help.

LT72884
11-03-2006, 02:11 AM
hmm, ok i will try not to use harsh language. lol..

ok. i have tryed su and what not,but what is sudo..anyway what im tryin to do is log in as root graphically. for example. when i boot up my pc, it takes me to the GUI log in screen where it says user name. i put in root and then my password for root. well when i hit enter it says root logins not accepted. is there a way that i can log in as root and be able to preform root actions in graphical mode. i realy do not like using the consule because im still used to windows where i can do all admin actions from the GUI. Im trying to edit the fstab file using kedit but it says i dotn have permissions for that. last time i gave the user all permisions it screwed up the whole system and i lost everything becasue it was trying to read and write certain actions to the filesytem but it couldnt find it cuz i muffed it up. so how do i log in as root in the GUI not the consule. i know about sudo and su commands. also im sorry for all this because i realy dont know how to explain it correctly. this is my first time using a linux distro. i prefer to be admin and have all the permissions so i can learn the system inside and out. thanx sooooooooo much for your help. i look forward to hear your responses.

OErjan
11-03-2006, 08:49 AM
running linux loged in as root is BAAAD, it is about only way to get viruses/trojans/malware in Linux, and too big risk to trash system if you do anything wrong, using "sudo" or even better "su -c" is MUCH safer, you can still crash things but you have one extra level of safety.

sudo is a way to do one single task as root, say open kedit to edit fstab, if you type comand below in konsole (in GUI) that will open kedit as root with fstab already opened.

sudo kedit /etc/fstab
or you could type

su -c "kedit /etc/fstab"
that will do same thing, su -c "command" is basically ask for root password, if correctly entered give me rootprivileges for comand between " " .

OErjan
11-03-2006, 09:16 AM
ofcource if you really want to be root i guess you could always start a second Xsesion as root, hit ctrl+alt+F2 then type
startx -- :1 -nolisten tcp you now will have two sessions,
switch between that session and your regular user with ctrl+alt+F5 and ctrl+alt+F6 (could be F4, F5... up to F9 but you will see)
just so you know $ in a bash prompt menas regular user and # that the user is root (bash-3.3$ = regular usr and bash-3.3# = root)
there can be 4 users loged into Knoppix on tty1-4 tty1 is knoppix and 2-4 are root as default iirc. so you will start X as root on second prompt.
if you then kill the pid that has knoppix bash prompt, you kill every process that knoppix has running, the line below (you get that line, and a few more, by typing ps aux|grep tty1 in a konsole)


USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 9996 0.0 0.0 1624 432 ? Ss Nov02 0:00 /usr/sbin/gpm -m /dev/mouse -t ps2
knoppix 9999 0.0 0.0 3416 1948 tty1 Ss Nov02 0:00 -bash
h
the PID is the number you see as second entry, type sudo kill 9999 in this case.

OErjan
11-03-2006, 09:22 AM
oh, one reason to learn linux in console is that you then can switch distribution and even manage unix systems without much effort, they are quite alike under the hood...
this means if you grasp basics that are taught in the floppix labs you can get by in most of them, just check manuals for the mst comon things like; vi, emacs, ls, rm, ln, ps, mv, chown, chmod, chgrp, kill...

to name one killall in some unixflavours does just that, kills whole system
another quirk was that rm alone in a old version of another OS deleted everything in the system in a blink (was RAPIDLY changed) , there are a few other such things.

LT72884
11-03-2006, 03:46 PM
ok. i try the sudo code but it says im not in the sudoers file and so i ant use it. I try the other but it says kedit is not a command and i cant find kedit. so can i do the sam ecode but with kwrite. I tryed the ctrl+alt+f2 and now im in bash screen and i try ctrl+alt+f1-f12 and i cant get back to my other sessions. so what is this sudoers file all about and why does knoppix hate me so much man. lol just jokin. any way thanx soo much for the help so far and i hope to hear more back from you guys.

here is what my bash says

LT72884@box:~$ su -c "kwrite /etc/fstab"
Password:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwrite: cannot connect to X server :0.0
LT72884@box:~$

i dont know if i did the code right or not. do i need to su to root b4 i do the code?

OErjan
11-03-2006, 05:33 PM
ok, you might have to be knoppix to be in sudoers file, try the full searchpath (i am on a Slackware system now but it may/should be same)
su -c "/opt/kde/bin/kedit /etc/fstab"

LT72884
11-03-2006, 06:43 PM
hmm. this is odd, all i have in the /opt folder is open office. i did a search for kedit and it says kedit does not excist on this machine, but kwrite does, but it still says the same message with sudo and su -c. im soo lost. lol.

LT72884
11-03-2006, 06:55 PM
also how do i become knoppix. i thought i was in knoppix. i loged on with my user name and what not, so shouldnt i be a knoppix user. also how do i add my user to the sudoers file. no one else uses this box. its just my test box. thats why im trying to make my user have alll the same permissions as root so i can learn this system inwards and out threw the GUI and aslo with the konsole

OErjan
11-03-2006, 08:58 PM
you type
su -c "visudo" hit enter and add what i wrot below to a new line below the one with knoppix.
yourusername ALL=NOPASSWD :ALL

you add text by hitting
i then use arowkeys to move cursor to point you want (end of the knoppixline) then enter to start new line, there you just type your username and rest same as for line with knoppix and hit
shift+q then q and w folowed by enter read here for explanation what that does.
http://floppix.com/vi.html

as for writing in fstab
su -c "kwrite /etc/fstab" should work as well.

there is no need to become knoppix, just that you have a different user than root is enough. otoh
su knoppix in a shell will switch you to become the user knoppix (if you are not already).

sad fact is that installing knoppix is a bad introduction to linux, it is much harder than need be, ubuntu or fedora even Debian or Slackware are better as they are intended for hddinstall, in knoppix things are deliberatly "broken" to work well as live CD.
something you will have to fight...

OErjan
11-03-2006, 09:10 PM
as for lerning system in GUI, not even close, you will only lern a few tools, not how things really work.

LT72884
11-05-2006, 03:06 AM
ok i had my boss help me out. but i have decided that knoppix is no the best choice to use. i should have used like red hat 9 or some thing that will allow me to log in with the GUI. im the onlyone who uses this computer and im installing it on my box so i can learn it. so i need to have all the permissions set for my user name so i can just log in and do what i need to do.

also im confused about mounting. here is what happened to me. I have 3 partitions, HDA1, HDA2, HDA3. HDA1 is for the install and 2 is for LFS and 3 is soloris swap. well i create a folder named LFS in the /home folder. i mounted hda2 to the /home/LFS folder and then i create a sub folder named sources in the LFS folder, so i have /home/lfs/sources. well when i umount hda2 my sources folder dissapeers but yet my lfs folder is still there. my reasoning for this is that the LFS folder was created on the hda1 and then the sources folder was created on hda2, so when i umount hda2 the ources folder dissapeers cuz hda2 is not mounted anymore. so basicaly im mounting one partition to another, for instance hda2 is mounted on mount point lfs which is on hda1. thanx soo far for all the help and for the help in advance

OErjan
11-05-2006, 09:55 AM
im installing it on my box so i can learn it. so i need to have all the permissions set for my user name so i can just log in and do what i need to do.

hmm, no that is falce thinking, in a "hot" environment you will not get the root password, you will be given a set of privileges that allow you to do certain things as admin, either with sudo or because you belong to a group that is alowed to do that/those task/s.

and i I would NOT use redhat 9, that is OOOOOLD!, old enough to be vulnerable and outdated anyway.
fedora is the free version of redhat.

as for loging in as root, DON*T!
I promice you will regret it, do ONLY what you absolutly NEED as root, pleeees, I promise it is as fast (atleast if put all the damage you must repair into equation), and MUCH safer.

yes you are correct, mounting is ataching the filesystem of the device to a directory, more below.

mounting is just getting acess to a certain filesystem of a certain device/partition at a specified point, the acess can be had wherever/however root wishes.
that is what /etc/fstab does, tell system where root wants the filesystems what type they are and what permisions they will have....

if you create a directory under, say, /mnt/hda2 directory, before mounting /dev/hda2 there, directory will be in same partition as /mnt is (likely /dev/hda1, first partition of first hd in your case).

But If you mount the filesystem of /dev/hda2 to the dir /mnt/hda2/ and then create a directory under /mnt/hda2, it will be in the filesystem of /dev/hda2.
the /dev/hda2 is the "filesystem" of second partition, but you need to mount it to some directory to be able to write to it in normal way.
Hmm, not entirely true, as alway there are ecceptions, you can still do a manual binary/hex edit, or a bit-by-bit copy of another filesystem of same size (and preferably same number of sectors heads and cylinders), with filesystem unmounted, but that is a different story.

keep asking.

LT72884
11-05-2006, 08:47 PM
LOL. ok so what distro of linux should i use that will teach me alot and allow me to learn the system. remember this is my first time using linux. is fedora the newest version. Im trying to learn this stuff before school starts in january becasue im going into computer forensics and becoming an "ethical hacker". that sort of stuff has always been an interest to me. if i dont become some great hacker thats ok becasue its still a great thing to know about. well i think i understand mounting a lil bit more.

Harry Kuhman
11-05-2006, 09:03 PM
...... is fedora the newest version. .....
You don't need (or even want) the newest version of a Linux distro, you would be better serverd by something stable and a lot like other Linux distros, as long as it has support for your hardware (some bleeding edge distros do have drivers for some newer hardware but are in turn less stable). There are many distros (http://distrowatch.com/) that you could select from, if you are interested in Knoppix and it runs on your hardware then Debian Etch (http://www.debian.org/releases/testing/) would be a distro to look at (although it seems likely that you will benefit from installing many different distros and learning the differences). As a Live CD, Knoppix is a great way to introduce new users to Linux, but it's not quite suitable for the average user to install to hard disk. You would also be well advised to listen to what others are telling you about not operating under the "I want all power at all times" mentality. If you are going to learn Linux that includes learig proper security issues and proper operation, and when root access is needed and should be used (and when it should not). Bypassing this will leave a big hole in your understanding of Linux.

OErjan
11-05-2006, 09:28 PM
hm, if you want to know Linux I would go with either slackware or Debian.
if you want something that is easy and "works" more or less out of box without effort ubuntu or fedora is what you want.

trouble is that the more "automated" the install and system administration is the more little anoyances pop up, most persons that have used linux for a while tend to choose slightly less automated approach, it is more stable and less prone to suicide.
the packagehandling in Debian is hard to match and the stability is great, Slackware is as stable and somewhat more "standard" EDIT the goal for Slackware is to make the most unixlike (whatever that is) and standard linux /EDIT no fancy patches, nothing flashy, but is rock solid. i would be hard pressed to say which is "better" of the two.
Fedora and Ubuntu are ok but you will only learn THEIR admin tools, not how LINUX work... someone that knows linux (read Slackware and/or Debian) can admin them all but someone that knows redhat/fedora/ubuntu is handicapped if outside his/her distro.

LT72884
11-05-2006, 11:02 PM
[quote=LT72884]...... is fedora the newest version. .....
"I want all power at all times" mentality. quote]

LOL, yes thats the problem im facing. i am soooo new to this stuff that i figure the only way to learn is to have all the power, when in reality, its no thtat way. thats why i luv you guys. you point me in the right direction.. im just so excited for school and allll the new info im going to learn. its gonna rock. ok so i need to learn when it is ok to su to root and when its not needed. Im gonna keep workin on my LFS ( Linux From Scratch) and see where that takes me, and in the mean time i will keep learning stuff. so what do you guys suggest i do besides NOT be power hungery.
thanx for all the help and thanx in advance.

OErjan
11-06-2006, 11:55 AM
As for what you should know, hmm, I have pointed you to the lab part of floppix ( http://floppix.com/labs.html ), that is a great source of basic knowledge, read them and try to understand them, I have yet to find any better crashcourse for linux.
if you use kwrite to edit the files instead of vi is up to you (as i said vi is on most *x).

as for LFS, that is like teaching a teen driving a car by being forced to take the place of an experienced driver without much knowlege, atleast not beyond knowing accelerator and steeringwheel, and that in the middle of a formula1 race.

hmm, as to what else, try to get a basic knowlege of what the diferent configfiles look like.

LT72884
11-07-2006, 05:05 PM
sorry for the late reply. i have been swamped at work. 5 computers went down over the weekend and i have to rebuild them all.. /wrists. this is onna be a long week. a psu went out on one and took every thing with it.

Ok so these configs files you speak of, where would i find them and how do i understand what theyare doing. i will prolly be printing a ton of stuff off of floppix today. give me something to do besides fix pc's all day. Yeah LFS is kinda advance but thats ok. i think i will learn alot form it once i start it.

LT72884
11-07-2006, 05:19 PM
Identify the command, options and arguments in the following:
ls -al /etc

Answer:
The command is: ls
There are two options: a and l
The argument is: /etc

hello there, here is an odd question. i know what these commands do but i dont understand what he means by arguments. ls lists the files and folders in a specific directory, a and l are the options, but how is /etc an argument. what does the term argument mean?

OErjan
11-07-2006, 06:38 PM
/etc is the searchpath to the dir where most (90%+) of systemwide configfiles are situated.
remaining configfiles you have to read the manual for ther specific program.

there is a bunch of files in your /home/username aswell, these are for the users settings.

LT72884
11-07-2006, 07:30 PM
interesting. well what does the term argument mean though. i was reading the floppix stuff and the guy said to identify the options and arguments in this command. i know what the options are but i dont know what the argument is and why. thanx in advance

OErjan
11-07-2006, 09:10 PM
cp /home/username/text.txt cp /home/username/text2.txt
there cp is copy., /home/username/text.txt is argument 1 and /home/username/text2.txt argument 2.

that is copy 1 to 2, not much more than that.

even a regular expression could be an argument, say cp -a /home/usernamne/* /home/usernamebackup/ the -a is preserve permisions and be recursive (for more look in man cp),
that would copy everything including dirs subdirs with permision preserved... from /home/username to the dir /home/usernamebackup.
and as you know /home/usernamebackup can be a different disk temporarily mounted there, or a diferent partition/disk in the computer...
these things will becoe more clear after a time of use.

LT72884
11-07-2006, 10:16 PM
lol, nice. these are all new terms to me. lol as you can tell. so i take it that the * means everything with in the/username folder. this is going to be tough to do full time work and also school.