Anthony Lopez

“I’d rather see a sermon than hear one any day;”

Setting up VSFTP using non-local users.

Posted by lopeza on August 12, 2009

Install Required packages

pam
db4
vsftpd
compat-db (this is the package name on fedora which provides the binary db42_load)

Configure PAM

# vi /etc/pam.d/vsftpd (I EDITED THE FILE TO LOOK LIKE THIS)
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers
#auth required pam_shells.so
#auth include system-auth
#account include system-auth
#session include system-auth
#session required pam_loginuid.so
(note: I had to comment out the bottom 6 lines to get the pam_userdb authentication to succeed for ftp logins. With them not commented out, authentication of known good users failed)

Create system user for vsftpd.conf (this is a dummy user, not logged into directly via FTP)
# adduser -d /home/virtualftp/ virtualftp

Configure vsftpd for virtual users

#vi /etc/vsftpd/vsftpd.conf (I EDITED THE FILE TO LOOK LIKE THIS)

local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# Virtual users will be logged into /home/virtualftp/[username]/
user_sub_token=$USER
local_root=/home/virtualftp/$USER
guest_enable=YES
guest_username=virtualftp
# Umask applied for virtual users and anon
anon_umask=0022
# Allows uploading by virtual users
anon_upload_enable=YES
# Allows creation of directories by virtual users
anon_mkdir_write_enable=YES
# Allows deletion of files and directories by virtual users
anon_other_write_enable=YES
# Sets a port range for passive mode. (must configure firewall to accept)
pasv_max_port=51123
pasv_min_port=51323
port_enable=YES

Setup virtual FTP usernames and their passwords (use the following format)

# vi /etc/vsftpd/vsftpd_users.txt

username1
passwordforusername1
username2
passwordforusername2
username3
passwordforusername3

Build the vsftpd database

#db42_load -T -t hash -f /etc/vsftpd/vsftpd_users.txt /etc/vsftpd/vsftpd_users.db
#chmod 600 /etc/vsftpd/vsftpd_users.db /etc/vsftpd/vsftpd_users.txt

Create directories for each virtual FTP user

#mkdir -p /home/virtualftp/username1

Test an FTP virtual user login

#ftp localhost
Connected to localhost.
220 (vsFTPd 2.0.5)
Name (localhost:root): username1
331 Please specify the password.
Password:
230 Login successful.

Advertisements

Posted in Learning, Linux | Leave a Comment »

The Bagster

Posted by lopeza on July 28, 2009

During many of my remodels I try to stack up as much debris as possible before ordering a dumpster.  Now there is the bagster.  It is an amazing idea at a great price.  I only wish they serviced more areas and provided a better lookup map on their site.  Their call center has no information on potential new service areas and just recommend to call or check the site frequently.

http://www.thebagster.com/

Posted in Vendors | Tagged: , , , , , , | Leave a Comment »

Sailing The Clipper City

Posted by lopeza on July 28, 2009

UPDATE! – The operations manager at this sailing company offered me an open bar deal for 50 of my company’s employees and promised to call me back with a sail date and invoice to solidify the deal.  A few days later when I called to follow-up she told me that she decided not to honor her offer.  I had asked to speak to the owner of the sailboat to discuss the poor business relationship that reneging on a deal would bring to their company, but the operations manager denied me the opportunity.  Their normal rates are overpriced as is and after breaking our deal I’d recommend NOT EVER TOURING ON THIER SAILBOAT.  Maybe I’ll feel differently when the owner calls me back to talk and honor his employee’s original deal!

The Clipper City was first built as a cargo schooner just prior to the Civil War, then rebuilt from the original plans, on loan from the Smithsonian Institution, and recently refurbished. The new, restored Clipper City, with a length of 160 feet and a height of 120 feet, can comfortably sail 144 people — the most of any passenger sailboat in the United States. With its sweeping deck, full bar, and eight sails, this majestic schooner and its attentive crew now sail daily from South Street Seaport, providing guests with a unique way to see Manhattan.

The original 1854 Clipper City schooner came from the shipyard of Manitowoc, Wisconsin, a town soon nicknamed “Clipper City” because of its growing reputation for shipbuilding. The plans for Clipper City are in the permanent collection at the Smithsonian, and a replica cross-section of the boat is on permanent display at the Wisconsin Maritime Museum. In 1856, the U.S. Nautical Magazine & Naval Journal reported that Clipper City could sail from Chicago to Port Washington, Wisconsin, a full 115 miles, in just seven and a half hours. Built to haul lumber, she was enormously successful in her time.

Clipper City was decommissioned in 1890, but in 1984 naval architects DeJong & Lebet re-built her, with adaptations to meet modern safety requirements. The new Clipper City, a steel-hulled schooner carrying six fore-and-aft rigged sails and two square topsails on two steel masts, was operated as a Baltimore charter vessel for 20 years. She then fell into disrepair, but was recently acquired and extensively renovated. The ship that sails daily from Pier 17 on South Street has been carefully restored to match the beauty of her Civil War–era ancestor.

Posted in Attractions | Tagged: , , , , , , | 1 Comment »

JP Morgan Corporate Challenge

Posted by lopeza on June 11, 2009

Yesterday, myself and a few coleagues ran the 5k charity race to help the Central Park Conservancy.  I am glad with my finish time and am looking forward to some more running.  finish time 29min 28secs.

Posted in Fun | Leave a Comment »

What if your only Windows 2003 Global Catalog Server fails

Posted by lopeza on June 4, 2009

Our environment was setup with a single global catalog server (or GCS) due to a misconfiguration.  When our domain controller/GCS failed/crashed we noticed that our secondary domain controller did not pick up the work of the GCS and our exchange email server was not functioning.

In order to resolve, we configured the secondary domain controller to be a GCS, had it seize the 5 FSMO roles, and configure our exchange server to use the new GCS. 

Seize the 5 FSMO roles:
http://support.microsoft.com/kb/255504

Make it a GCS:
http://support.microsoft.com/?id=313994

Remove the crashed DC from AD sites and services:
Delete the servername and rebuild the server and readd it. (But there are many different things you can do here)

Update Exchange system manager:
Reconfigure the “Recipient update service” to the running DC for both entries.

To check for errors you can run:
C:\Program Files\Support Tools\dcdiag /v > c:\dcdiag.txt
C:\Program Files\Support Tools\netdiag /v > c:\netdiag.txt

Posted in Windows | Leave a Comment »

How to set up Dell Openmanage for usage with yum CentOS5

Posted by lopeza on April 24, 2009

I set this up successfully on a poweredge 2950 running centos5.3

  1. Set up this repository:
    wget -q -O – http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
  2. Install Open Manage:
    yum install srvadmin-all
  3. Start Open Manage services
    srvadmin-services start

Posted in Linux | Leave a Comment »