Geek Projects – Linux, Apache, MySQL, PHP, DNS A Linux Sysadmin

March 24, 2009

vsftpd's “500 OOPS: cannot change directory” error

Filed under: Linux — Matt @ 2:00 pm

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

March 19, 2009

Resuming failed Firefox downloads

Filed under: Linux — Matt @ 9:45 am

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

March 2, 2009

Bypass rm's “argument list too long” error message with xargs

Filed under: Linux — Tags: , , — Matt @ 3:19 pm

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

Powered by WordPress