PDA

View Full Version : Tried Creating a new user to use with Showeq but get errors



Stixaw
09-17-2002, 08:52 AM
I am using Redhat 7.2 and if I run Showeq as root it opens but all I see is a Human level 1 warrior which is not what is logged in, Infact it is a dwarf cleric level 5.

If it try to run Showeq as any user I create i get this error
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
showeq: cannot connect to X server :0
[user@machinename bin]$
I try typing
$ xhost +127.0.0.1
and I get the same error:
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
showeq: cannot connect to X server :0

First why when I am root do i not see anything?

and Why when I create a user and use su to run Showeq do I get these errors.

Thanks,:confused:

fryfrog
09-17-2002, 10:11 AM
1.) did you start SEQ before or after you logged into EQ?
2.) did you get a libEQ.a file?
3.) are you using "su" or "su -"? (should use "su" or "sudo su" as the - says "assume all variables as root" or something like that... so it doesn't see that X is running)

Stixaw
09-17-2002, 10:47 AM
1) both
2) Yes I did get the Libeq.a it took 9 tries but it said download completed, would I have been able to do the make and make install if that didn't download?

is there a better ftp other than smurfette.....?

3) I am at [......root]# su username
get username......root] $
however it never asks for a password.

Also just to check what rights does the user need if any?

Thanks for the help

fryfrog
09-17-2002, 10:53 AM
er, wait lemme make sure i know what you mean...

most people would do this:

log into X using the user "notroot", then open an xterm and type "su" (and the root password) to get a root shell... then start seq in the normal manner... is this what you mean?

it SEEMS (and i've been wrong before) like you are logging in as "root" and then "su" ing to become "notroot". i hope i just read that wrong :)

seq HAS to run as root, because to sniff libpcap has to also run as root :(

Stixaw
09-17-2002, 12:24 PM
This is how I am doing it:

Machine boots up and I log in as Root
then open a terminal session and su


When I run as root I do get the showeq to run
just no data so i am sure my hub now is a switch.

If I want to use a user like you say fryfrog to run SEQ could you point me into how to create and then log on as this user.

I appreciate your assistance thus far.

Thanks,:confused:

fryfrog
09-17-2002, 01:16 PM
useradd <username>
passwd <username>


login as <username>


su

Dedpoet
09-17-2002, 02:28 PM
Stixaw, I just want to make sure you understand what everyone is saying. Fry's post above is correct in how to make a user. The point of all of this is that you have to be the user root to run Seq. Who you log into the workstation as is not important, it can be any user at all. Most people advise against logging in as root though because that gives you the power to do all sorts of bad things to your own workstation as well as being a security risk.

Once you are logged in as your user, you will want to use the "su" command to "switch user". Just running "su" with no user name switches you to the user root. "su root" would do the same thing. Now you can start showeq. The fact that you're not seeing any data is probably a networking issue, as you mentioned.

Note that although no one here would recommend it, you could log in as root in the first place and run showeq straight away, without doing any "su" since you are already the correct user.

I hope that is clear...I found the combination of posts in this thread a bit confusing for a newbie to follow.

fryfrog
09-17-2002, 02:39 PM
yeah, listen to the dedpoet. i personally run X as root. i know, its bad and stupid but its just SOOO much easier :)

i have shortcuts in my fluxbox that are labeled with computer names so that my gf can easily start seq if she needs to and we are happy. if all you use your box for is seq, there really isn't anything wrong with running X as root, as long as you don't mind maybe having to start over when you accidentally do something stupid... which is STILL very possible as you are "becoming" root when you su anyway... so any stupid mistake in THAT terminal window will blow you... away... :)

Stixaw
09-17-2002, 03:41 PM
Dedpoet and Fryfrog,

Thank you both this now makes sense.

I appreciate your giving a newbie to Linux of your knowledge.

Thanks,:)

Morannon
09-18-2002, 03:19 AM
Why not just set the SUID for showeq ?

chown root showeq
chmod 4755 showeq

Then you can run SEQ without having to log in as root.

Dedpoet
09-18-2002, 07:17 AM
Because you need to have root access for the NIC to run in promiscuous mode.

Morannon
09-19-2002, 06:11 AM
Im assuming that was a reply to me, Dedpoet ?

If so, I'm not sure I understand what you mean.

fryfrog
09-19-2002, 06:23 AM
now, i haven't tried it so i cannot say if he (or i) am right or not...

but if your seq box is not your gateway, the nic has to go into promisc mode (sniffing traffic that isn't destined for our mac). the only user that is allowed to put a nic into this mode is root, so i'm not sure if setting the SUID bit would work. course, if YOU are using it and your seq box is NOT your gateway/firewall then it must work eh? :)

basically i think libpcap has to run as root, but i could be wrong :)

Dedpoet
09-19-2002, 06:50 AM
Yes, it's a libpcap thing. If you notice, the permissions on /usr/local/bin/showeq are already -rwxr-xr-x. You can start showeq as any user but you will get this error:



Session management error: Could not open network socket
.
.
.
pcap_error:pcap_open_live(eth0): socket: Operation not permitted
Make sure that you are running ShowEQ as root.

Morannon
09-19-2002, 07:26 AM
Well, im not sure what -rwxr-xr-x has to do with anything.

My post said to use 4755 : which is -rwsr-xr-x

That coupled with the chown to root, means the program runs with the SUID bit set, so it effectively runs as the user who owns the file, and not the user running the program.

Ive been a UNIX systems admin for nearly 12 years - which is why I couldnt understand why you were telling me what I had said wouldnt work - especially since I know it does =)

fryfrog
09-19-2002, 09:20 AM
thanks for the tip, if i ever get off my lazy ass and switch from running X as root -> running X as a user, i will have to rember this. sounds like something that should be added to the faq ;)

Dedpoet
09-19-2002, 11:40 AM
Sorry Morannon, I didn't see the '4'. I am also an experienced Unix admin, apparently just not a very observant one. :rolleyes:

STiLE
09-22-2002, 07:53 PM
OMG FryFrog shame on you running X as root =\ I didnt read every post but the easiest solution here is to run X as USER (for security sake...not that anyone wants to break into your shitty box but still its good practice). Once X is up and running do an su - and do a setuid for seq (chmod +s <path_to_seq_app>). This is also a security risk but much less than running X as root. This way you can run seq as a normal user and save yourself from the hassle of su'ing all the time.

Stixaw
09-27-2002, 08:01 AM
Well It worked Dedpoet and Fryfrog,

I now have it up and running and am logged in with a user and the su now allows me to run showEQ.

Also had to get a old old hub but hey thanks!

Pigeon
09-30-2002, 06:09 PM
I run SEQ as SUID. Works fine.

You need to make /usr/local/share/showeq and all the non-map files in it writable by the user you want to run SEQ on though.