David L. Anselmi | 1 Aug 2010 07:51
Picon

Re: Fun* with ssh tunnels

Don Marti wrote:
> I used to do this something like...
>
>    ssh -L 10025:localhost:25 $MAILHOST sleep 5&
>
[...]
>
>    /usr/bin/ssh -A -L 10025:localhost:25 \
>                 -R 10022:localhost:22 \
>                 $MAILHOST \
>      /usr/bin/ssh -p 10022 localhost /usr/sbin/postqueue -f
>
> So the "postqueue" command is running on the client.

*That* is fun.  How creative.

Might this also work though:

ssh -L 10025:localhost:25 $MAILHOST -N -f && /usr/sbin/postqueue -f

This seems to do the right thing if ssh can't connect, but maybe not if it connects but the remote 
port isn't listening.  Also the setting of ExitOnForwardFailure might matter.

The connection stays open (in the background) until signaled to stop.  I think yours will be all 
cleaned up after postqueue runs so maybe the extra convolution is worth it.

Cheers!
Dave
_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
(Continue reading)

Don Marti | 1 Aug 2010 20:18

Re: Fun* with ssh tunnels

begin David L. Anselmi quotation of Sat, Jul 31, 2010 at 11:51:08PM -0600:

> >So the "postqueue" command is running on the client.
> 
> *That* is fun.  How creative.
> 
> Might this also work though:
> 
> ssh -L 10025:localhost:25 $MAILHOST -N -f && /usr/sbin/postqueue -f
> 
> This seems to do the right thing if ssh can't connect, but maybe not
> if it connects but the remote port isn't listening.  Also the
> setting of ExitOnForwardFailure might matter.
> 
> The connection stays open (in the background) until signaled to
> stop.  I think yours will be all cleaned up after postqueue runs so
> maybe the extra convolution is worth it.

The ssh back method works for me and has never left an
extra ssh process behind.  It's the least troublesome*
of the various ways I've tried to do this, and I've
sent mail from a variety of weird café and airport
networks.

The -N -f method works, too.  Cleaning up the
leftover ssh process is a couple of extra lines in
the mail script.  If you have a Debian system you
can run something like:

  start-stop-daemon --pidfile .ssh_tunnel_pidfile --make-pidfile \
(Continue reading)

Jason White | 29 Aug 2010 05:10

Re: Fun* with ssh tunnels

I just upgraded to OpenSSH 5.6 and added the following to ~/.ssh/config:
ControlMaster auto
ControlPath /tmp/%r <at> %h:%p
ControlPersist 1h

The inactivity time-out can be adjusted, or you can simply specify "yes"
to keep the background ssh process around indefinitely. Since the second
and subsequent ssh sessions use the shared connection, there is almost
no delay - ideal for tunnels, provided that you have already established
the first connection to create the background ssh process.

_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
linux-elitists mailing list
linux-elitists <at> zgp.org
http://zgp.org/cgi-bin/mailman/listinfo/linux-elitists

Jason White | 29 Aug 2010 05:30

nmcli and NetworkManager configuration

NetworkManager is increasingly being installed by Linux distributions
these days. Recent versions come with a shell utility, nmcli, intended,
for use by users who prefer the command line (I'm in that category) and
for servers. I understand that NM provides multiple network profiles and
facilitates the configuration of WPa2, 3G modems, etc.

Some of those features could be useful. I've read the nmcli(1) manual
page and experimented with running nmcli, but it seems to be missing the
ability to configure new connections. (Having just installed NM, I don't
have any profiles or interface configurations set up.)

How is one supposed to configure NM from the shell, i.e., without
running X?

Are there any alternative projects that I should look at?

The main use cases at the moment are, for example, switching between
multiple network profiles with different IPv4/IPv6 configurations;
setting up wireless (including WPA2) networking quickly on a laptop,
etc. I could write shell scripts, of course, but I'd rather work with
daemons and tools designed for the purpose than to reinvent what others
are devoting significant development effort to create.

_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
linux-elitists mailing list
linux-elitists <at> zgp.org
http://zgp.org/cgi-bin/mailman/listinfo/linux-elitists

(Continue reading)

Marc MERLIN | 29 Aug 2010 16:48

Re: nmcli and NetworkManager configuration

On Sun, Aug 29, 2010 at 01:30:45PM +1000, Jason White wrote:
> The main use cases at the moment are, for example, switching between
> multiple network profiles with different IPv4/IPv6 configurations;
> setting up wireless (including WPA2) networking quickly on a laptop,
> etc. I could write shell scripts, of course, but I'd rather work with
> daemons and tools designed for the purpose than to reinvent what others
> are devoting significant development effort to create.

While we're at it, if someone knows how to tell nm-applet that my home
wireless password does not change, and a wireless failure is not a valid
reason to make me re-enter my wireless password?
(online help deals with not having the keyring password unlock, but I solved
that a long time ago).

Thanks,
Marc
--

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
linux-elitists mailing list
linux-elitists <at> zgp.org
http://zgp.org/cgi-bin/mailman/listinfo/linux-elitists

Don Marti | 29 Aug 2010 17:04

Re: nmcli and NetworkManager configuration

begin Jason White quotation of Sun, Aug 29, 2010 at 01:30:45PM +1000:

> How is one supposed to configure NM from the shell, i.e., without
> running X?

It looks like NM uses gconf, so you can use
gconftool-2 to read and change settings:
  http://www.arachnoid.com/linux/NetworkManager/

(Of course, there's this on the horizon:
  Migrating from GConf to GSettings
  http://library.gnome.org/devel/gio/2.25/ch27.html
so we may be in for another iteration of "this
distribution is run by crack smokers who got rid of
a subsystem right when it started working" versus
"this distribution is run by pedantic nerds who won't
give me teh new shiny" flamage.)

--

-- 
Don Marti                    
http://zgp.org/~dmarti/
dmarti <at> zgp.org
_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
linux-elitists mailing list
linux-elitists <at> zgp.org
http://zgp.org/cgi-bin/mailman/listinfo/linux-elitists

Gary Sandine | 29 Aug 2010 20:20
Favicon

Re: nmcli and NetworkManager configuration

On Sun, Aug 29, 2010 at 01:30:45PM +1000, Jason White wrote:
> Are there any alternative projects that I should look at?
> 
> The main use cases at the moment are, for example, switching
> between multiple network profiles with different IPv4/IPv6
> configurations; setting up wireless (including WPA2) networking
> quickly on a laptop, etc. I could write shell scripts, of course,
> but I'd rather work with daemons and tools designed for the
> purpose than to reinvent what others are devoting significant
> development effort to create.

I recently set up an openbox-based desktop system and found wicd a
bit more pleasant to deal with at a command line (I don't know about
using it for managing IPv6 though):

http://wicd.sourceforge.net/

$ apt-cache search wicd
python-wicd - wired and wireless network manager - Python module
wicd - wired and wireless network manager - metapackage
wicd-cli - wired and wireless network manager - scriptable cli client
wicd-curses - wired and wireless network manager - Curses client
wicd-daemon - wired and wireless network manager - daemon
wicd-gtk - wired and wireless network manager - GTK+ client

Regards,
--

-- 
Gary Sandine <gars <at> laclinux.com>
_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
(Continue reading)

Phil Mayers | 31 Aug 2010 13:46
Picon

Re: nmcli and NetworkManager configuration

On 08/29/2010 04:04 PM, Don Marti wrote:
> begin Jason White quotation of Sun, Aug 29, 2010 at 01:30:45PM +1000:
>
>> How is one supposed to configure NM from the shell, i.e., without
>> running X?
>
> It looks like NM uses gconf, so you can use
> gconftool-2 to read and change settings:
>    http://www.arachnoid.com/linux/NetworkManager/

To be more precise (i.e. pedantic!) NetworkManager uses dbus to get user 
and system connection settings. The default user settings provider is 
nm-applet, which stores its connection info in gconf and the system keyring.

The default system settings provider depends on the NM version, but in 
newer version is usually a plugin which reads (and in some cases writes) 
system /etc files. This plugin does not support non-ethernet connection 
types, so you might need to chain a 2nd plugin, keyfile, to store those.

AFAIK there is no "configure NetworkManager" dbus API; instead you edit 
the backend that the system/user settings provider reads (and hope it 
has file/database change notification). This is probably not optimal.
_______________________________________________
Do not Cc: anyone else on mail sent to this list.  The list server is set for maximum one recipient.
linux-elitists mailing list
linux-elitists <at> zgp.org
http://zgp.org/cgi-bin/mailman/listinfo/linux-elitists

Phil Mayers | 31 Aug 2010 13:56
Picon

Re: nmcli and NetworkManager configuration

On 08/29/2010 04:30 AM, Jason White wrote:
> NetworkManager is increasingly being installed by Linux distributions
> these days. Recent versions come with a shell utility, nmcli, intended,
> for use by users who prefer the command line (I'm in that category) and
> for servers. I understand that NM provides multiple network profiles and
> facilitates the configuration of WPa2, 3G modems, etc.
>
> Some of those features could be useful. I've read the nmcli(1) manual
> page and experimented with running nmcli, but it seems to be missing the
> ability to configure new connections. (Having just installed NM, I don't
> have any profiles or interface configurations set up.)

NM is pretty damn good these days IMO. It's bluetooth DUN support wowed me.

>
> How is one supposed to configure NM from the shell, i.e., without
> running X?

If you're not running X, nm-applet won't be running and thus won't be 
providing the User settings service. Therefore any NM connections will 
need to be "system" connections. NM get the config for these by running 
one or more plugins. This is a good primer:

http://live.gnome.org/NetworkManager/SystemSettings
http://live.gnome.org/NetworkManagerConfiguration

The short version is that NM will read RedHat/Fedora-style ifcfg-* 
files, so you can just write these out. However, the ifcfg plugin only 
support ethernet-style connections, not VPN or DUN/PPP/3G.

(Continue reading)

Phil Mayers | 31 Aug 2010 14:18
Picon

Re: nmcli and NetworkManager configuration

On 08/31/2010 12:56 PM, Phil Mayers wrote:
> On 08/29/2010 04:30 AM, Jason White wrote:
>> NetworkManager is increasingly being installed by Linux distributions
>> these days. Recent versions come with a shell utility, nmcli, intended,
>> for use by users who prefer the command line (I'm in that category) and
>> for servers. I understand that NM provides multiple network profiles and
>> facilitates the configuration of WPa2, 3G modems, etc.
>>
>> Some of those features could be useful. I've read the nmcli(1) manual
>> page and experimented with running nmcli, but it seems to be missing the
>> ability to configure new connections. (Having just installed NM, I don't
>> have any profiles or interface configurations set up.)
>
> NM is pretty damn good these days IMO. It's bluetooth DUN support wowed me.
>
>>
>> How is one supposed to configure NM from the shell, i.e., without
>> running X?
>
> If you're not running X, nm-applet won't be running and thus won't be
> providing the User settings service. Therefore any NM connections will
> need to be "system" connections. NM get the config for these by running
> one or more plugins. This is a good primer:
>
> http://live.gnome.org/NetworkManager/SystemSettings
> http://live.gnome.org/NetworkManagerConfiguration
>
> The short version is that NM will read RedHat/Fedora-style ifcfg-*
> files, so you can just write these out. However, the ifcfg plugin only
> support ethernet-style connections, not VPN or DUN/PPP/3G.
(Continue reading)


Gmane