Turning off safe_mode and open_basedir in Plesk
Thu, 08/30/2007 - 22:17 — sandipCreate a "vhost.conf" file in "/var/www/vhosts/<DOMAIN.TL
<Directory /var/www/vhosts/<DOMAIN.TLD >/httpdocs>
php_admin_value safe_mode off
php_admin_value open_basedir none
</Directory>
Rebuild the domain configs for the particular host via:
/usr/local/psa/admin/sbin/webs rvmng -u --vhost-name=<DOMAIN.TLD> ;
or rebuild all via:
# /usr/local/psa/admin/sbin/webs rvmng -a
cleanup ftp backups with bash shell script
Wed, 08/29/2007 - 22:54 — sandipHere's a small bash code snippet to clean up ftp backups maintained by date. Specifically, if using the SysBK to backup to an external server with just ftp access.
It should be run daily via cron and cleans up folders older than 14 days.
#!/bin/bash
# clean_bak.sh
# Cleans up old backup folders from the remote server.
USR=<user>
PSWD=<password>
HOST=<ftp.domain.tld>< br />BAK_PATH=</path/to/backup s>
LFTP=/usr/bin/lftp
RM_DATE=`/bin/date +%m-%d-%y -d '15 days ago'`
$LFTP << EOF
set ftp:ssl-force true
connect $HOST
user $USR $PSWD
rm -r -f $BAK_PATH/${RM_DATE}
du -h -d 1 $BAK_PATH
quit
EOF
exit 0
The du option will output the space currently being used by the backups.
NOTE: For security reasons, you should use ftps protocol to connect to the remote backup server if possible, and can force it via:
set ftp:ssl-force true
This can also be put in the "~/.lftprc" or "~/.lftp/rc" file.
- sandip's blog
- Login or register to post comments
GalleryRemote on Ubuntu Edgy 6.10
Sun, 08/26/2007 - 22:54 — sandipGallery Remote install kept erroing out with:
Preparing to install...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
nawk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
Launching installer...
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/usr/local/java/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
The way around the error was to comment out the assumed kernel.
$ cp GalleryRemote.1.5.Linux.NoVM.b in GalleryRemote.1.5.Linux.NoVM.b in.bak
$ cat GalleryRemote.1.5.Linux.NoVM.b in.bak | \
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > GalleryRemote.1.5.Linux.NoVM.b in
Once installed Gallery Remote would not run and I had run the same hack for the Gallery_Remote launcher script as well.
$ cp Gallery_Remote Gallery_Remote.bak
$ cat Gallery_Remote.bak | \
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > Gallery_Remote
- sandip's blog
- Login or register to post comments
Securing SSH Using Denyhosts
Sun, 08/26/2007 - 11:50 — david23SSH is a great way to remotely administer a server. However, it still has a number of issues when you open it up to the world. The server and client communications are secure but that doesn’t mean the hosts involved are. Opening an SSH service to the world allows for brute force attacks and means that the carbon interface is still the weakest link.
- david23's blog
- Login or register to post comments
services that are not necessary on a web server
Tue, 08/21/2007 - 15:45 — sandipThese are some services I would normally turn off on web servers.
NOTE: usage may vary.
- gpm -- mouse
- mdmonitor -- monitor raid devices
- netfs -- nfs, samba etc...
- autofs -- automount, nfs, cd etc...
- kudzu -- detect new hardware
- restorecond -- monitor selinux file context
- mcstrans -- mandatory access control selinux translation
- messagebus -- routes messages between applications
- haldaemon -- maintains database of devices connected
There may be more, but if you've cleaned up your rpm packages, it would probably not exist.
- sandip's blog
- Login or register to post comments
- Read more
rpm packages not necessary for a web server
Tue, 08/21/2007 - 15:37 — sandipBelow is a list of rpm packages that are not necessary on a web server. Use it as a reference starting point for cleaning up servers. You may also want to make sure not to run services not required by the server.
NOTE: usage may vary and removal should be in the order listed:
-
redhat-lsb cups system-config-printer-libs system-config-printer paps -- printer support
-
system-config-soundcard -- gui for sound setup
-
system-config-securitylevel-tu
i -- gui for setting up security
-
nfs-utils system-config-nfs nfs-utils-lib -- nfs server
- portmap -- manage RPC connections
- ypbind yp-tools -- NIS client binding
-
htmlview -- view webpages via gui
-
system-config-services system-config-samba pinfo system-config-users system-config-date -- gui configs
-
samba samba-client samba-common -- samba support
- oprofile oprofile-devel oprofile-gui qt
- vnc
-
libglade2 libgnomecanvas usermode-gtk libbonoboui libgnomeui libglade-java pygtk2-libglade system-config-httpd system-config-network gnome-mount libgnome-java gnome-python2-bonobo gnome-python2-canvas gnome-python2 authconfig-gtk system-config-lvm authconfig-gtk pirut gnome-vfs2 gnome-python2-gnomevfs gnome-python2-gconf libgnome libgsf librsvg2 librsvg2
ImageMagick -
gnome-mime-data gnome-keyring notify-python
- GConf2 notification-daemon bluez-gnome libgconf-java libnotify bluez-utils
- libgtk-java libvte-java
- pygtk2 system-config-language system-config-rootpassword
- vte
- libwnck
- glib-java cairo-java frysk
- libwmf
- gtk2
-
cups-libs
-
ghostscript ghostscript-fonts
- avahi avahi-glib
- wpa_supplicant NetworkManager
- system-config-rootpassword
-
system-config-language
- system-config-keyboard
- system-config-network-tui firstboot-tui
-
system-config-securitylevel-tu
i -
dhcpv6_client dhcdbd dhclient -- dhcp support
- irda-utils -- Infra Red communications
- isdn4k-utils -- ISDN
- apmd -- laptop power management
- cpuspeed -- dynamically changing cpu speed
- bluez-libs -- bluetooth
- irqbalance -- irq load balancing on multi-cpus (remove only in single cpu situation)
- rsh -- unsecure remote access
- talk -- internet talk protocol
- foomatic -- printer driver database
- finger -- finger client
- eject -- eject removable media
-
cvs -- concurrent version control
- rcs -- revision control system
- dosfstools mkbootdisk -- bootdisk
- redhat-menus desktop-file-utils startup-notification -- desktop
- ppp rp-pppoe wvdial -- dialup
- esound -- sound daemon
- pcmciautils -- PCMCIA Cardbus
- pcsc-lite coolkey ifd-egate ccid
- OpenIPMI net-snmp-libs
- ImageMagick-devel -- ImageMagick development package xorg-x11-devel -- X server development package
- acpid -- power management (remove if you don't shutdown using power button)
How to install Tor with Vidalia GUI on Ubuntu
Sun, 08/19/2007 - 02:28 — david23Do you want completely anonymous internet access? For Free? Tor is the open source leader to anonymous connections on the internet, you can anonymize your internet presence from AIM/ICQ/MSN/ Jabber/IRC/WWW/FTP and you can even issue a torify
command at the command prompt to anonymize your wget/ssh/lynx/ftp/perl or whatever. Basically tor is for the people by the people, it is only alive because we make it so, we can choose to use it freely or use it freely and help it out by running a server on your computer to make the internet safer.
- david23's blog
- Login or register to post comments
- Read more
How to Install Tor to Surf Anonymously in Ubuntu Feisty with Firefox
Mon, 08/13/2007 - 04:24 — david23Tor is a toolset for a wide range of organizations and people that want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and other applications that use the TCP protocol. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.
- david23's blog
- Login or register to post comments
Check your server for rootkits with Chkrootkit
Thu, 08/09/2007 - 16:25 — sandipchkrootkit is a tool to locally check your system for signs of a compromise via rootkits. It contains a shell script that checks system binaries for rootkit modification, signs of LKM trojans, interface modes and lastlog, wtmp, utmp deletions.
Install via:
# cd /usr/local
# wget ftp://ftp.pangeia.com.br/pub/s eg/pac/chkrootkit.tar.gz
# tar xvzf chkrootkit.tar.gz
# rm chkrootkit.tar.gz
# ln -s chkrootkit-x.xx chkrootkit
# cd chkrootkit
# make sense
Make sure to check the md5sum of the download as well.
Put the below into "/etc/cron.daily/chkrootkit.sh
#!/bin/bash
# chkrootkit.sh
cd /usr/local/chkrootkit/
./chkrootkit 2>&1 |grep "INFECTED\|Vulnerable&quo t;| grep -v "Checking \`bindshell'... INFECTED (PORTS: 465)"
The cron script will only output an email if it detects anything suspicious.
Note, that bindshell port 465 infection is a false alarm as in my case EXIM uses port 465 for secure connections. So, you could similarly grep out any such false alarm and adjust the cron script.
- sandip's blog
- Login or register to post comments
Howto Set Flickr images as Ubuntu desktop wallpaper
Wed, 08/08/2007 - 08:12 — david23Webilder delivers stunning wallpapers to your Linux desktop, directly from Flickr and Webshots. You choose what keywords (tags) to watch for, and photos are automatically downloaded to your computer. Webilder can also change the wallpaper every few minutes.
- david23's blog
- Login or register to post comments