Archive

Posts Tagged ‘linux’

Getting SNMPD to work on Ubuntu

June 22nd, 2010 No comments

Setting up snmpd on ubuntu seems easy, but i never got it full working. It was working locally, but not for a cacti setup from another server. The problem was that the default install of snmpd on Ubuntu starts the demon on the loopback interface only, refusing connections from other computers.

Edit /etc/default/snmpd to fix that:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This file controls the activity of snmpd and snmptrapd
 
# MIB directories.  /usr/share/snmp/mibs is the default, but
# including it here avoids some strange problems.
export MIBDIRS=/usr/share/snmp/mibs
 
# snmpd control (yes means start daemon).
SNMPDRUN=yes
 
# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
 
# snmptrapd control (yes means start daemon).  As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run.  See snmpd.conf(5) for how to do this.
TRAPDRUN=no
 
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
 
# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes

that’s it. To restart the snmp server enter $ sudo /etc/init.d/snmpd restart

Categories: Sysadmin Tags: , , ,

Ubuntu: networking tip

February 26th, 2007 No comments

I upgraded one server to new hardware by changing the complete HP machine, but using my harddrive from the “old” server. As these two machines are almost identically, except for the processor (dual core now) this should have worked like a charm – and it did! (almost)

I rebooted on the new hardware, all services and serves came up, no problems so far. But when i tried to ping some other machine, this didn’t work :-(

I checked /var/log/messages and the onboard Broadcom Interface showed up as eth1, but i was not able to start it. When i ran $ sudo /etc/init.d/networking restart i got some error messages like:

SIOCSIFADDR: No such device eth1
eth1: ERROR while getting interface flags: No such device

No clue what went wrong, i googled a lot and finally i stumbled upon this forum entry: http://ubuntuforums.org/showthread.php?t=221768

Then i ran: $ ifconfig -a
and got a list with my network interfaces and more importantly with it’s MAC address.

Then i edited /etc/iftab and changed the MAC address of the old hardware to the new onboard interface’s MAC address.

restart the networking with $ sudo /etc/init.d/networking restart

YESS, it works!

Categories: Sysadmin Tags: , , ,

Ubuntu Server insecurity?

February 19th, 2007 No comments

i just found out that my Ubuntu Server 6.10 has login shells for almost all users set in the /etc/passwd file!

That’s a very bad idea because this maybe enabled someone to install “Data Cha0s Back Backdoor” on my machine :-(

I checked this with 2 other fresh Ubuntu Server 6.10 installations and both had the login shells for users like daemon, mail, www-data and so on. Especially www-data should not have a chance to create a shell in my opinion!

So i changed /bin/sh to /usr/sbin/nologin and hope this makes it a bit more secure.

Categories: Sysadmin Tags: , , ,

Installing Flash Media Server 2 on Ubuntu 6.10

January 14th, 2007 6 comments

The installation script for Flash Media Server works only on RedHat Enterprise by default. With some modifications it works fine on Ubuntu Edgy:

1
2
3
4
5
6
7
apt-get install libnspr4 libstdc++5 libstdc++5-3.3-dev
wget http://download.macromedia.com/pub/flashmediaserver/updates/2_0_3/linux/flashmediaserver2.tar.gz
tar xfz flashmediaserver2.tar.gz
cd FMS*
wget http://www.bluetwanger.de/~mbertheau/fms.patch
patch -p1 < fms.patch
sudo ./installFMS

Live aus der Marschrutka – Installing Flash Media Server 2 on Ubuntu 6.10 Edgy

this howto is written bei Markus Bertheau, please check the original article and his blog here. with his great patch my installation of FMS2 on my Mac Book Pro running Ubuntu 6.10 server inside Parallels Desktop worked like a charm :-)

Categories: Webdev Tags: , , ,

The power of vim

March 22nd, 2006 No comments

vim is the commandline text editor vi (improved) and it features syntax highlight and colors. The good thing is, vim is included by default in Mac OS X – the bad thing is, color support is not enabled by default. To enable syntax highlight in vim create a .vimrc file in your home directory:

1
2
set term=builtin_ansisyntax
onset background=dark

if you have a color enabled ls installed in your system, this might be useful too:

1
export LS_COLORS='no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35'

di=01;33 colors directories in ls in bold yellow instead of hard-to-read-darkblue on black terminal windows. You can use this line either directly on your commandline or put it in /etc/profile for everyone on your system or just for yourself into ~/.bashrc

Categories: Sysadmin Tags: , ,