ToC Home Issues Hearts Links

Issue #2, June 2005

SlackTips

In this issue, you will find the following materials:

ALSA mini-HOWTO

Stanislaw Flatto wrote :
> But I am disgressing, started trying to teach Linux the ALSA lingo...

From: Thomas Overgaard
Subject: Re: [OT] The joys(?) of using Slackware
Date: Wed, 11 May 2005 22:10:53 +0200
Newsgroups: alt.os.linux.slackware
(Original Thread)

If it's a brief ALSA howto you want then here it is:

  1. As root run 'alsaconf'. alsaconf tries to identify your noisegenerator and load the appropriate modules. If successful it asks if it should write to /etc/modules.conf so that the modules will load at boot time.
  2. Run 'alsamixer' and unmute the generator and then adjust the noise level to your liking and exit (press <Esc>).
  3. Run 'alsactl store' and the settings from alsamixer is saved in /etc/asound.state and from now they are loaded from here when ALSA starts.

Thomas O.
This area is designed to become quite warm during normal operation.


Starting a desired WM automatically

eneph wrote on 24 Apr 2005:
> ok well i changed the file so that it starts x automaticly but it
> always starts gnome and my pc doesnt have the resources to support it
> so it goes VERY slow...how can i get fluxbox to start. i have chosen
> it like 3 times in xwmconfig

From: Floyd L. Davidson
Subject: Re: starting startx automatically
Date: Sat, 23 Apr 2005 19:29:35 -0800
Newsgroups: alt.os.linux.slackware
(Original post)

    $ ln -s /etc/X11/xinit/xinitrc.fluxbox ~/.xinitrc

Better yet,

    $ cp /etc/X11/xinit/xinitrc.fluxbox ~/.xinitrc

And then edit it as desired. For example, regardless of which of the xinitrc files is used, the last line to be executed exec's a window manager. So changing window managers is just a matter of putting which ever wm is desired there, or setting up a menu to select one of many.

But before the window manager is exec'd, it is sometimes nice to initialize a few things, or even start programs. I run xcalc, and used to run three instances of xterm, from ~/.xinitrc. Before doing that I run xhost, xset to change the console bell and the mouse rate, plus xsetroot to set the background color. YMMV for what is useful or necessary.

Do note that the way to execute any of those programs is like this,

     #
     #  run the calculator on the right screen
     #
     if [ -x /usr/X11R6/bin/xcalc ]; then
       /usr/X11R6/bin/xcalc -g 390x480--0+-0 &
     fi

Note that is verifies the existance and permissions, and then runs the program with '&' so that it is asynchronous. That last is essential, because if for some reason the program hangs, it won't hang the startup of X (in a way that would be very hard to determine the cause for too).


--
Floyd L. Davidson
Ukpeagvik (Barrow, Alaska)


Running several instances of sshd

On Mon, 23 May 2005 05:08:38 -0700, Mikhail Zotov wrote:
> I'd like to implement the following access policy via ssh to a server:
> all users from group A may authenticate themselves with passwords, but
> users from group B -- only with authorized keys.  (This is a group of
> privileged users and I don't want their passwords to be cracked.)
> Do I understand man sshd_config correctly that there is no
> opportunity to achieve the goal by means of configuring sshd and
> I have to use some other approach?

From: Menno Duursma
Subject: Re: ssh: access with passwords for group A, with keys only for group B?
Date: Tue, 24 May 2005 12:54:16 GMT
Newsgroups: comp.os.linux.security
(Original post)

Just run two sshd processes on different ports, with separate config-files. Something like:

   groupadd sshpw
   groupadd sshkey
   
   vigr <-- put the users in the apropriate groups.
   
   cd /etc/ssh
   cp sshd_config sshd_config_pw
   vi sshd_config_pw <-- edit to have:
   
           Port 2222
           PermitRootLogin no
           AllowGroups sshpw
   
   cp sshd_config sshd_config_key
   vi sshd_config_key <-- edit to have:
   
           Port 3333
           PermitRootLogin no
           PasswordAuthentication no
           AllowGroups sshkey

In /etc/rc.d/rc.sshd in place of /usr/sbin/sshd put something like:

   if [ -r /etc/ssh/sshd_config_pw ]; then
     echo "Starting SSH service: /usr/sbin/sshd -f /etc/ssh/sshd_config_pw"
     /usr/sbin/sshd -f /etc/ssh/sshd_config_pw
   fi
   if [ -r /etc/ssh/sshd_config_key ]; then
     echo "Starting SSH service: /etc/sbin/sshd -f /etc/ssh/sshd_config_key"
     /usr/sbin/sshd -f /etc/ssh/sshd_config_key
   fi

Restart the SSH service.

(For users) on clients you might want to:

   echo "Port 3333" >>$HOME/.ssh/config

And/or globally in /etc/ssh/ssh_config, so they don't have to specify "-p".

HTH.
--
-Menno.


Where to put -- -nolisten tcp?

Colossus wrote:
> X is started by kdm the KDE session manager, so how to give that
> flag to X ?

From: dent...@c2i2.com (dentonj)
Subject: Re: where to put -- -nolistentcp ?
Date: 18 Jul 2004 20:16:22 -0700
Newsgroups: alt.os.linux.slackware
(Original post)

For a full list of where to stop X from listening to port 6000:

   /usr/X11R6/bin/startx:
   serverargs="-nolisten tcp"

   /etc/X11/gdm/gdm.conf:
   command=/usr/X11R6/bin/X -nolisten tcp

   /etc/X11/xdm/Xservers:
   :0 local /usr/X11R6/bin/X -nolisten tcp

   /opt/kde/share/config/kdm/Xservers:
   :0 local@tty1 /usr/X11R6/bin/X vt7 -nolisten tcp

You may sometimes see UDP Port 177 open. This is the XDMCP service that allows remote X logins. Both Gnome and KDE have XDMCP disabled by default. It can be enabled in these files:

   /etc/X11/gdm/gdm.conf
   /opt/kde/share/config/kdm/kdmrc

XDM listens to port 177 by default. You have to edit /etc/rc.d/rc.4 to disable xdm from listening to that port:

   /etc/rc.d/rc.4:
   exec /usr/X11R6/bin/xdm -nodaemon -udpPort 0

kdm and xdm use Xaccess files to control who can request a remote X login. gdm uses the gdm.conf file to control access. A few years ago Slackware had an uncommented "*" in the Xaccess file for xdm which allowed anyone to get a remote X login. Now the default is everything is commented out.

   /etc/X11/xdm/Xaccess
   /etc/X11/gdm/gdm.conf
   /opt/kde/share/config/kdm/Xaccess


dentonj


Editor's remark: In Slackware 10.0 and 10.1, XDMCP is disabled in XDM by default by the following lines in /etc/X11/xdm/xdm-config :

   ! SECURITY: do not listen for XDMCP or Chooser requests
   ! Comment out this line if you want to manage X terminals with xdm
   DisplayManager.requestPort:   0

Automatic generation of tagfiles from an existing Slackware installation

The script was originally written by bmgz <bm...@yahoo.com> and posted at alt.os.linux.slackware on Sun, 27 Feb 2005, see this and this posts, and slightly edited by Mikhail Zotov incorporating an idea on using sed by James Michael Fultz.

#!/bin/bash
# 
# The script prepares Slackware tagfiles from the list of packages
# installed in the machine.  The script can be used in case one
# wants to install the same set of Slackware packages on another
# machine.  (Surely, there are other ways to implement the task.)
#
# Before running the script, edit the DISKSETPATH variable below.
# This must be a path to a directory where the Slackware `tree'
# (i.e., directories a, ap, d, ... x, y) can be found together
# with the corresponding tagfiles.  One has to mount both CDs one
# after another if the second CD was used during installation and
# to run the script twice (i.e., once for each CD).
# 

DISKSETPATH="/mnt/cdrom/slackware"
#DISKSETPATH="/home/linux/slack/current/slackware"

# Create a list of installed packages
echo -n "Creating list of installed packages... "

# Here we use rules which seem to work properly with both stock
# Slackware packages and those downloaded form linuxpackages.net.
# This is not needed for our purpose but it doesn't hurt.
# The list of installed packages can be used for other purposes, too.

ls /var/log/packages/* | sed 's/-[^-]\+-[^-]\+-[^-]\+$//' \
 | sed 's|/var/log/packages/||' > installed-packages.txt
echo "done!"

for PACKAGESET in $(ls $DISKSETPATH); do
  if [ -d $DISKSETPATH/$PACKAGESET ]; then
    echo -n "Generating tagfile for package set $PACKAGESET/ ... "

    if [ ! -d ./$PACKAGESET ]; then
      mkdir $PACKAGESET
    fi

    if [ ! -s ./$PACKAGESET/tagfile  ]; then
      cp $DISKSETPATH/$PACKAGESET/tagfile ./$PACKAGESET/tagfile
    fi

    cat ./$PACKAGESET/tagfile | egrep -v ^\# | sed 's/: *.../: SKP/' \
      > ./$PACKAGESET/tagfile

    while read PACKAGE ; do
      if [ $(grep -c $PACKAGE ./$PACKAGESET/tagfile) -gt 0 ]; then
        sed "s/$PACKAGE: SKP/$PACKAGE: ADD/;w $PACKAGESET/tagfile.tmp" \
          $PACKAGESET/tagfile 1> /dev/null
        cp ./$PACKAGESET/tagfile.tmp ./$PACKAGESET/tagfile
      fi
    done < installed-packages.txt
    echo "done!"
  fi
done
find . -name tagfile.tmp | xargs rm
# EOF


BerliOS Logo