Disable SFTP

In a test/UAT environment you might find it prudent to disable nasties like SFTP, FTP or mailx, such that if you’ve copied your scripts and config file over from production, they don’t inadvertently send you test files out to ‘live’ users & systems.

A quick way to do this is create a /bin directory in your user’s root and put in ‘dummy’ executable versions of ftp, mail, mailx and sftp (say with a single echo statement embedded).

Now add this directory to your $PATH so that it gets called before the real commands.

(eg edit ~./profile and add PATH=.:/usr/local/etc:~/bin🙂

Double check with a “which sftp” and it should now point to your dummy version.

Leave a Reply