Re: [opensuse] init.d script automatic start, not (just) run (solution?/work around)
On Wed, Apr 8, 2009 at 3:00 AM, Per Jessen
Neal Hogan wrote:
What I want is a script to start at boot time or as soon as it's finished booting and running X, etc. I'm in the (un)fortunate position of maintaining my parents machine and I want to have access to it whenever. It's behind a firewall, so I need to make an ssh tunnel that I can use to get at their machine (eg., ssh -R 4444:localhost:22 user@server). I've done this before on another system, where I just put the ssh script in their .xinitrc. But, the OpenSUSE system doesn't seem to require the .xinitrc, so I'm trying to accomplish this task without using it.
Without having thought a lot about it, I would do something like this:
create a script /etc/init.d/sshtunnel - use /etc/init.d/skeleton as a template. Amend the script to do the startproc ssh -R 4444:localhost:22 user@server. Then use insserv to get the script inserted into the init-sequence. I would probably use runlevel 3.
I've done this numerous times, always works.
Well, I've followed the suggestions, which are much appreciated, and still did not get an automatic ssh connection (I would have to manually *start* it). So, I've added the *start* to a gnome session. Thanks for your help. -Neal
/Per
-- Per Jessen, Zürich (12.1°C)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- www.nealhogan.net www.lambdaserver.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Neal Hogan wrote:
On Wed, Apr 8, 2009 at 3:00 AM, Per Jessen
wrote: create a script /etc/init.d/sshtunnel - use /etc/init.d/skeleton as a template. Amend the script to do the startproc ssh -R 4444:localhost:22 user@server. Then use insserv to get the script inserted into the init-sequence. I would probably use runlevel 3.
I've done this numerous times, always works.
Well, I've followed the suggestions, which are much appreciated, and still did not get an automatic ssh connection (I would have to manually *start* it).
Does it require any sort of user inter-action to start? A password or some such? If not, I really don't see why it doesn't start. Never mind, you've got it to work anyway. /Per -- Per Jessen, Zürich (11.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, Apr 9, 2009 at 3:17 AM, Per Jessen
Neal Hogan wrote:
On Wed, Apr 8, 2009 at 3:00 AM, Per Jessen
wrote: create a script /etc/init.d/sshtunnel - use /etc/init.d/skeleton as a template. Amend the script to do the startproc ssh -R 4444:localhost:22 user@server. Then use insserv to get the script inserted into the init-sequence. I would probably use runlevel 3.
I've done this numerous times, always works.
Well, I've followed the suggestions, which are much appreciated, and still did not get an automatic ssh connection (I would have to manually *start* it).
Does it require any sort of user inter-action to start? A password or some such? If not, I really don't see why it doesn't start. Never mind, you've got it to work anyway.
As a matter of completeness, I will add that I have set up the ssh connection to not require a password (authentication key). Thanks a lot for your help, Per.
/Per
-- Per Jessen, Zürich (11.6°C)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- www.nealhogan.net www.lambdaserver.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Neal Hogan skrev: > On Thu, Apr 9, 2009 at 3:17 AM, Per Jessenwrote: > >> Neal Hogan wrote: >> >> >>> On Wed, Apr 8, 2009 at 3:00 AM, Per Jessen wrote: >>> >>>> create a script /etc/init.d/sshtunnel - use /etc/init.d/skeleton as a >>>> template. Amend the script to do the startproc ssh -R >>>> 4444:localhost:22 user@server. >>>> Then use insserv to get the script inserted into the init-sequence. I >>>> would probably use runlevel 3. >>>> >>>> I've done this numerous times, always works. >>>> >>> Well, I've followed the suggestions, which are much appreciated, and >>> still did not get an automatic ssh connection (I would have to >>> manually *start* it). >>> >> Does it require any sort of user inter-action to start? A password or >> some such? If not, I really don't see why it doesn't start. Never >> mind, you've got it to work anyway. >> >> > > As a matter of completeness, I will add that I have set up the ssh > connection to not require a password (authentication key). > > Thanks a lot for your help, Per. > > >> /Per >> >> >> -- >> Per Jessen, Zürich (11.6°C) >> >> -- >> To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org >> For additional commands, e-mail: opensuse+help@opensuse.org >> >> >> > > > > Hi - just one question...is your network (really) up and running at the time your script is invoked? - one more; if you use a name and not an IP for your connection, is your DNS stuff ready at the time your script is invoked? Best regards, Verner -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Neal Hogan
-
Per Jessen
-
Verner Kjærsgaard