Thursday, November 15, 2012

snmpd setup

It's pretty easy to enable snmpd on OpenBSD. Simply edit /etc/snmpd.conf to configure the interface which snmpd should listen on, and left other settings by default. Fireup snmpd and it will listen on udp port 161.

Then you can use snmp tools such as MRTG or Cacti to retrieve info via SNMP version 2.

Tuesday, November 6, 2012

get packages for current & previous version of OpenBSD

http://ftp.openbsd.org/pub/OpenBSD/ftplist

Only packages of current three versions available on the official FTP. Some of other mirror FTPs also have packages of very early versions.

 

Tuesday, October 30, 2012

SSH: Agent Admitted Failure To Sign...

When you encounter error message of "SSH: Agent Admitted Failure To Sign..." with your new ssh key, just simply log off current session and re-login again.

Another way to fix this issue within the current session is to type # ssh-add, then the new key will be added to ssh-agent.

REFERENCE:
http://www.cyberciti.biz/faq/unix-appleosx-linux-bsd-agent-admitted-failuretosignusingkey/

ssh port-forwarding in the background

$ ssh -fNL 2222:localhost:2222 pride

REFERENCE :
Lucas, M. W. SSH Mastery: OpenSSH, Tunnels and Keys

Monday, October 29, 2012

chmod -R 700 ~/.ssh for authorized_keys

permission of 700 may be required for correct setup of ssh key authorization!

Sunday, October 28, 2012

chroot sftp & batch it!

1) edit /etc/ssh/sshd_config:
Match User backup
ChrootDirectory /var/backup
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

2) # kill -HUP `cat /var/run/sshd.pid`

3) create the new user, generate key,  and set permissions:
# mkdir -p /home/backup/.ssh
# useradd backup
# ssh-keygen -t dsa 
# cp id_dsa.pub /home/backup/.ssh/authorized_keys
# mkdir -p /var/backup/dir1
# chown root:wheel /var/backup
# chmod 755 /var/backup
# chown backup /var/backup/dir1

3) edit a batch file, sftp_batch  for sftp:
cd dir1
put myfile

4) then, fireup sftp client for batch processing now!
# sftp -b sftp_batch backup@localhost

REFERENCES:
http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny

Saturday, September 15, 2012

syslog to a remote central log host

# vi /etc/syslog.conf


*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none @loghost
auth,daemon,syslog,user.info;authpriv,kern.debug                @loghost

=> save then reboot!