I recently installed a vsftpd FTP server on a CentOS Linux 5.2 box. After changing the FTP user’s home directory, I received the following error message every time I attempted to login as ftp:
500 OOPS: cannot change directory
500 OOPS: child died
Permissions were setup correctly on the ftp user’s home directory, so I did some digging around, and discovered that there’s an SELinux setting that causes this problem. I didn’t want to turn SELinux off, so the solution was to run the following command, which enables access to the ftp user’s home directory.
setsebool -P ftp_home_dir
Firefox’s download manager doesn’t have a built-in mechanism for resuming failed downloads. My Internet connection was cut off just long enough this morning for a Firefox download of an ISO image to fail. To resume the download, I used the wget command, which is built into most Linux distributions, and installable if you’re running OS X or Windows. If you’re running Windows you can download wget from GnuWin32. If you’re running OS X, you can install wget with DarwinPorts.
To resume the failed Firefox download, open up a terminal, change to the directory that the is located in, and issue the wget command with the -c option. The -c option tells wget to continue the failed Firefox download. For example:
cd Downloads
wget -c http://download.mozilla.org/failed-download
When using rm to delete a large number of files, you may come up against a kernel limitation which limits the length of arguments that can be sent to rm:
$ rm *
bash: /bin/rm: Argument list too long
This one-liner utilizes xargs to bypass this limitation:
ls | xargs rm
I’m always forgetting the command that’s needed to start CPAN’s configuration wizard back up after its initial setup. To reconfigure CPAN, just execute the follow command from the CPAN prompt:
o conf init
Here are the settings that I used to get a Linksys PAP2T-NA working with Gizmo:
- Browse to the PAP2T-NA’s web page, for example http://192.168.111.100
- Click the PAP2T-NA’s “Admin Login” link
- Click on the “Line 1″ tab
- Fill in the following three values, and hit submit:
- Proxy: proxy01.sipphone.com
- Display Name: Your Name
- User ID: Your Gizmo SIP number, for example 17471234567
- Password: Your Gizmo password
- Click the “Save Settings” button
That’s it! Your Linksys PAP2T-NA is now configured to use your Gizmo account.
I’m currently performing an online upgrade from SLES 10 (SUSE Linux Enterprise Server 10) to SLES 10 SP2. While following Novell’s instructions on upgrading from SLES 10 to SLES SP1, I hit the error message below:
sles10-32bit:~ # switch-update-server
You use an internal update server. Abort.
The fix was to edit /usr/bin/switch-update-server , comment out the following lines, then run switch-update-server again.
# check if there is a old or new update server
#if ! echo "$CHECK_URIS" | grep -F "$NEW_SERVER_NAME" >/dev/null 2>&1 &&
# ! echo "$CHECK_URIS" | grep -F "$OLD_SERVER_NAME" >/dev/null 2>&1; then
# # no old and no new update server => not registered or use an internal mirror
# # no need to switch
# echo "You use an internal update server. Abort." >&2
# echo "You use an internal update server. Abort."
# exit 1
#fi
Windows XP Professional offers a Remember my password checkbox when mapping to a network drive, or other password protected network resource.
Unfortunately, once you’ve set a password, the Remember my password box disappears, so future username or password changes can result in repeated password prompts. Here’s how to clear your previously set username and password, and get the Remember my password checkbox back:
- Click Start -> Run
- Type in control userpasswords2, and press Enter
- Click on the Advanced tab
- Click the Manage Passwords button
- Select the server for which you wish to delete existing settings, then click the Remove button
- Click Close
- Click OK
- Logout of Windows XP, then back in
- Connect to the password protected server. You should now be prompted for your username and password, along with the previously missing Remember my password checkbox
The above may work in other version of Windows, but I haven’t tested this out. Please post a comment if you’ve been able to use this procedure to get the Remember my password box back under your Windows version!
Mac OS X doesn’t come with a sha1sum utility. Neither does fink. So what’s the quickest way to check a sha1sum on a Mac? Use openssl:
openssl sha1 filename
If you’d like to roll this sha1sum check into a simple bash script, create the following sha1sum script:
#!/bin/bash
/usr/bin/openssl sha1 $1
Then make the sha1sum script executable, and run it:
chmod 755 sha1sum
./sha1sum filename
Here’s a guide to setting up a FreeBSD server to relay emails for a set of IP addresses and/or hostnames. Be very careful to only enable relaying for trusted machines. Ideally, you’d setup your FreeBSD sendmail server to require authentication.
- Enable sendmail on your FreeBSD server by adding the following line to the /etc/rc.conf file:
sendmail_enable="YES"
- Start sendmail using FreeBSD’s rc.d system.
/etc/rc.d/sendmail start
- Add the IP address or IP addresses that you’d like sendmail to relay mail for to the /etc/mail/access file. For example, the following lines enable relaying for all emails coming from 10.0.2.1, and any IP address starting with 192.168.0.
10.0.2.1 RELAY
192.168.0 RELAY
- cd to your FreeBSD server’s /etc/mail directory, and run make to apply your changes to sendmail.
cd /etc/mail
make
djbdns is a DNS server package that was created in response to BIND’s history of security holes. Whenever I setup a Linux or FreeBSD DNS server, I try to use djbdns rather than BIND. Here’s how to setup a DNS caching server using FreeBSD 6.x and djbdns’s dnscache mode. The following commands should be run with root, su or sudo:
- Install the djbdns port, and its dependencies.
cd /usr/ports/dns/djbdns
make install clean
rehash
- Enable the supervise service, which is used to start djbdns.
echo 'svscan_enable="YES"' >> /etc/rc.conf
mkdir /var/service
usr/local/etc/rc.d/svscan.sh start
- Create djbdns’s cache and log accounts.
pw useradd Gdnscache -d /nonexistent -s /sbin/nologin
pw useradd Gdnslog -d /nonexistent -s /sbin/nologin
- Configure djbdns as a DNS caching server. In the examples below, 192.168.0.1 is the IP address of the interface that the djbdns DNS caching server will run on, and 192.168.0/24 is the network that I want to allow to access the server. Subsitute in the appropriate IPs and range(s) for your network.
dnscache-conf Gdnscache Gdnslog /usr/local/etc/dnscache 192.168.0.1
ln -s /usr/local/etc/dnscache /var/service
touch /var/service/dnscache/root/ip/192.168.0
/usr/local/etc/rc.d/svscan.sh restart
Sources: