Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Getting internet right after login
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Mon Dec 17, 2007 12:30 am    Post subject: [SOLVED] Getting internet right after login Reply with quote

Hi,

Currently, no matter what I do with trying to get internet to be ON when I log in, playing with my "wireless" file, or playing with my "net" file, I just can't seem to get my internet to be working the second I log into my machine as user. To get (wireless) internet, I have to go into the shell, and use:

[code]
$ sudo iwconfig eth1 essid "Home" nickname "Gentoo Node" key [1] 1234567890 open
[/code]

and THEN I can surf the net.

How can I get this command to run at startup without me typing it in every time? (This is what I'm going to consider my quick-fix solution to my internet woest atm. If it works right now, out of the box, then I'm happy. What (mis-configurating) I can't see can't hurt me.


Last edited by GivePeaceAChance on Tue Dec 18, 2007 8:48 am; edited 1 time in total
Back to top
View user's profile Send private message
baeksu
l33t
l33t


Joined: 26 Sep 2004
Posts: 607
Location: Seoul, Korea

PostPosted: Mon Dec 17, 2007 1:45 am    Post subject: Reply with quote

If you use KDE, Gnome or XFCE, you can add the command to the autostart. Otherwise you can use it in your .xinitrc or .xsession file, depending on whether you do 'startx' or use KDM/GDM.

If you only use the terminal, however, the only thing I can think of is to make an alias for it in your .bashrc. At least then you won't have to type such a long command every time.

If you don't care about logging in, you could also always add it to your /etc/conf.d/local.start
_________________
Gnome:
1. A legendary being.
2. A never ending quest to make unix friendly to people who don't want unix and excruciating for those that do.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Mon Dec 17, 2007 2:53 am    Post subject: Reply with quote

I'm drawing a blank.... where is the .xinitrc file? :P I use fluxbox, btw.
Back to top
View user's profile Send private message
dnial
n00b
n00b


Joined: 14 Mar 2007
Posts: 19
Location: Cincinnati OH

PostPosted: Mon Dec 17, 2007 3:07 pm    Post subject: Reply with quote

/etc/xinit/xinitrc
Back to top
View user's profile Send private message
JC99
l33t
l33t


Joined: 06 Aug 2003
Posts: 719
Location: Toronto

PostPosted: Tue Dec 18, 2007 1:36 am    Post subject: Reply with quote

You can add any command to be run at boot in this file...


/etc/conf.d/local.start
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 2:30 am    Post subject: Reply with quote

Good to know! :P Now about this command: in order to use it, I either have to su into root, or use sudo, which I set up for my user. As such, I can't see how it can be run at boot, since it requires a password input. Is there a way to give it that too, or should I go about this a different way altogether?
Back to top
View user's profile Send private message
Inodoro_Pereyra
Advocate
Advocate


Joined: 03 Nov 2006
Posts: 2625
Location: En la otra punta del cable

PostPosted: Tue Dec 18, 2007 4:06 am    Post subject: Reply with quote

sudo will not require any password to run if you put in your /etc/sudoers:
Code:

here_your_username   ALL=(ALL) NOPASSWD: ALL


Salud!
_________________
Mi Blog.

Si no fuera por C, estaríamos escribiendo programas en BASI, PASAL y OBOL.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 5:04 am    Post subject: Reply with quote

OK, but what if I want the user to input the password each time they sudo, except for this one instance, is that possible? (if not, I'll just go ahead and put that line in sudoers)
Back to top
View user's profile Send private message
JC99
l33t
l33t


Joined: 06 Aug 2003
Posts: 719
Location: Toronto

PostPosted: Tue Dec 18, 2007 5:18 am    Post subject: Reply with quote

Why not create a new user with the right permissions and only use that user for this. That way your account isn't affected.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 5:30 am    Post subject: Reply with quote

Not a bad idea. I'll give it a try. :)
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 6:09 am    Post subject: Reply with quote

OK, I created a new user called networking like this:

Code:
useradd -G users -p tehinterweb networking


I'm hoping that's right, because when I typed "groups networking" it spit out "users networking"

Anyway, that said, the only reason I want this user is to run the following command when my computer turns on (i.e. a background process that only I actually know about since I made it) so I don't care to have anything else going on with this user.

Now I want the command to run. So in /etc/local.start, I want to make this user run the following command:

Code:

sudo iwconfig eth1 essid "Home" nickname "Gentoo Node" key [1] 1234567890 open


How do I do that and make the user 'networking' execute that command? And does /etc/local.start run the commands when the computer turns on, or when a user, say 'Me' logs in?
Back to top
View user's profile Send private message
JC99
l33t
l33t


Joined: 06 Aug 2003
Posts: 719
Location: Toronto

PostPosted: Tue Dec 18, 2007 6:14 am    Post subject: Reply with quote

Yeah, that looks right

P.S. Its /etc/conf.d/local.start not /etc/local.start
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 6:19 am    Post subject: Reply with quote

Right. D'oh. so how do I make "networking" execute the command though? I'm assuming just putting this line in that file won't work:

Code:

sudo iwconfig eth1 essid "Home" nickname "Gentoo Node" key [1] 1234567890 open


Something has to tell the computer that I want "networking" to execute that command, right?
Back to top
View user's profile Send private message
JC99
l33t
l33t


Joined: 06 Aug 2003
Posts: 719
Location: Toronto

PostPosted: Tue Dec 18, 2007 6:30 am    Post subject: Reply with quote

Try that line and see if it works then let us know.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 8:31 am    Post subject: Reply with quote

Here's my file. Gonna reboot and see what happens.

Code:

# /etc/conf.d/local.start

# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)

sudo iwconfig eth1 essid "Home" nickname "Gentoo Node" key [1] 1234567890 open
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Dec 18, 2007 8:50 am    Post subject: Reply with quote

Jesus..... talk about a weird way to go about doing what I wanted in my initial post. :P Well it works, so no worries I guess. Mind you, this is still just a quickfix while I'm at home with a known wireless connection that I know I won't be deviating from. We'll see what happens when I get back to university.

Thanks for helping me out. That's one thing off my long Gentoo todo list, no matter how "quick-fix/temporary" this may be.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum