| View previous topic :: View next topic |
| Author |
Message |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Mon Dec 17, 2007 12:30 am Post subject: [SOLVED] Getting internet right after login |
|
|
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 |
|
 |
baeksu l33t


Joined: 26 Sep 2004 Posts: 607 Location: Seoul, Korea
|
Posted: Mon Dec 17, 2007 1:45 am Post subject: |
|
|
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 |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Mon Dec 17, 2007 2:53 am Post subject: |
|
|
I'm drawing a blank.... where is the .xinitrc file? I use fluxbox, btw. |
|
| Back to top |
|
 |
dnial n00b

Joined: 14 Mar 2007 Posts: 19 Location: Cincinnati OH
|
Posted: Mon Dec 17, 2007 3:07 pm Post subject: |
|
|
| /etc/xinit/xinitrc |
|
| Back to top |
|
 |
JC99 l33t


Joined: 06 Aug 2003 Posts: 719 Location: Toronto
|
Posted: Tue Dec 18, 2007 1:36 am Post subject: |
|
|
You can add any command to be run at boot in this file...
/etc/conf.d/local.start |
|
| Back to top |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 2:30 am Post subject: |
|
|
Good to know! 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 |
|
 |
Inodoro_Pereyra Advocate


Joined: 03 Nov 2006 Posts: 2625 Location: En la otra punta del cable
|
Posted: Tue Dec 18, 2007 4:06 am Post subject: |
|
|
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 |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 5:04 am Post subject: |
|
|
| 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 |
|
 |
JC99 l33t


Joined: 06 Aug 2003 Posts: 719 Location: Toronto
|
Posted: Tue Dec 18, 2007 5:18 am Post subject: |
|
|
| 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 |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 5:30 am Post subject: |
|
|
Not a bad idea. I'll give it a try.  |
|
| Back to top |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 6:09 am Post subject: |
|
|
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 |
|
 |
JC99 l33t


Joined: 06 Aug 2003 Posts: 719 Location: Toronto
|
Posted: Tue Dec 18, 2007 6:14 am Post subject: |
|
|
Yeah, that looks right
P.S. Its /etc/conf.d/local.start not /etc/local.start |
|
| Back to top |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 6:19 am Post subject: |
|
|
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 |
|
 |
JC99 l33t


Joined: 06 Aug 2003 Posts: 719 Location: Toronto
|
Posted: Tue Dec 18, 2007 6:30 am Post subject: |
|
|
| Try that line and see if it works then let us know. |
|
| Back to top |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 8:31 am Post subject: |
|
|
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 |
|
 |
GivePeaceAChance Guru

Joined: 26 May 2007 Posts: 480
|
Posted: Tue Dec 18, 2007 8:50 am Post subject: |
|
|
Jesus..... talk about a weird way to go about doing what I wanted in my initial post. 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 |
|
 |
|