How to make SSH start automatically??

Each time I start the internet I have to open a shell and type:

ssh -l -C followed by enter.
then I have to type my password.

I would like to add an entry to my root menu so when I chose that a box automatically pops up where I must type the password and the afterwards I should have access to the internet.

I have tried the follwowing:

DestroyMenu MenuFvwmRoot
AddToMenu MenuFvwmRoot “Root Menu” Title

  • “&1. Logon (Net)” Exec exec gksudo xterm #ssh -l -C

where I have entered the correct info for user/host.

But it does nothing, any hints?

If that’s what you really have then it makes no sense to xterm, what you want is:

Exec exec gksudo xterm -e 'ssh -l <user> -C <host>'

– Thomas Adam

As you recommended I have tried:

+"&3. Logon (Net)" Exec exec gksudo xterm -e 'ssh -l -C ’

It does not work. I have also tried without the quotes (’ '), but the gives the same result.

How do you start your FVWM session?

I just turn on the computer when it comes to the login screen I write my password and my user and then FVWM starts.

right - so you’ll probably find the error messages that get generated by your X apps in a file called .xsession-errors. they might shed some light on this matter.

Everything after gksudo works if I paste it into a terminal window here, so that’s probably not your problem. I can’t comment on gksudo since I don’t use it myself

Ok this is what I have in my .fvwm2rc file under menus:

+"&3. Logon (Net)" Exec exec gksudo xterm -e ssh -l -C

When I open .xsession-erros after I have tried to select the Logon (Net) option it looks like this:

(I included the whole file. I think Its only the first part and especially the last part that is interesting )

/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
/etc/gdm/PreSession/Default: running: /usr/bin/X11/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x “/var/lib/gdm/:0.Xservers” -h “” -l “:0” “johs”
/etc/gdm/Xsession: Beginning session setup…
[FVWM][scanForPixmap]: <> Couldn’t load image from /usr/share/gnome-system-tools/pixmaps/runlevel.png
[FVWM][scanForPixmap]: <> Couldn’t load image from gnome_apps.png
[FVWM][scanForPixmap]: <> Couldn’t load image from default-applications-capplet
[FVWM][Read]: <> file ‘/ect/X11/fvwm/menudefs.hook’ not found
_cdim: — not moved 0x0814b2d0 mailto:'emacs@localhost.localdomain

(gksudo:4436): Gtk-WARNING **: Unable to locate theme engine in module_path: “gtkqt”,
/etc/gtk-2.0/gtkrc:12: Unable to locate image file in pixmap_path: “22x22/actions/text_bold.png”
[color=red]…and many more of these…[/color]
/etc/gtk-2.0/gtkrc:540: Unable to locate image file in pixmap_path: “22x22/actions/viewmag-.png”
KThemeStyle cache seems corrupt!

/home/johs/.gtk_qt_engine_rc:309: error: unexpected character {', expected character }’
gksudo: invalid option – e
GKsu version 1.2.0

Usage: gksudo [-u ] [-k] [-l]

–user , -u
Calls as the specified user
–message , -m
Replaces the standard message shown to ask for
password for the argument passed to the option
–title , -t
Replaces the default title with the argument
–icon , -i
Replaces the default window icon with the argument
–print-pass, -p
Asks gksu to print the password to stdout, just
like ssh-askpass. Useful to use in scripts with

programs that accept receiving the passowrd on
stdin.

–disable-grab, -g
Disables the “locking” of the keyboard, mouse,
and focus done by the program when asking for
password
–ssh-fwd, -s
Strip the host part of the $DISPLAY variable, so that
GKSu will work on SSH X11 Forwarding.

–login, -l
Makes this a login shell. Beware this may cause
problems with the Xauthority magic. Run xhost
to allow the target user to open windows on your
display!
–preserve-env, -k
Preserve the current environments, does not set $HOME
nor $PATH, for example.

_cdim: — not moved 0x0814b920 mailto:'emacs@localhost.localdomain

[color=red]Edited by theBlackDragon:
–> Removed repetitive uninteresting error messages[/color]

hmm… gtksudo seems to think that -e flag was for its benefit.

Ok but I guees I will not make it work with gksudo then.

Might I suggest, bigblop that in the future, you consider NOT posting a full blown error log, but instead upload it to some webspace that you can then quote a URL for us to see?

In answer to your question, you’ll simply have to ensure that you quote things correctly, hence you want to use:

+"&3. Logon (Net)" Exec exec 'gksudo xterm -e ssh -l <user> -C <host>'

– Thomas Adam

Ok sorry for the big message.

In your first reply you write:

Exec exec gksudo xterm -e 'ssh -l -C ’

but now you write:

Exec exec 'gksudo xterm -e ssh -l -C ’

I have just tried:

+"&3. Logon (Net)" Exec exec ‘gksudo xterm -e ssh -l blop_pf -C 12.0.0.1’

according to your latest reply and it still does not work.

I guees that I misunderstand something…

It could well be me – both versions I quoted work from within Xterm, but from within FvwmConsole, I had to change it yet again, this time using:

Exec exec gksudo 'xterm -e ssh -l <name> -C <host>'

Henceforth the above ought to work from within a menu as well.

– Thomas Adam

Bingo! Now it works! Thanks once again for your help

I start fvwm like this from my ~/.xsession

# start window manager
exec /usr/bin/ssh-agent fvwm2

Then I have a menu entry to run x11-ssh-askpass

Test (x /usr/lib/misc/ssh-askpass) AddToMenu MenuInternet %key2.png%"Add Agent Identity" Exec ssh-add < /dev/null

Once you’ve entered your password you can just Exec exec xterm -e ssh foobar :slight_smile: