Disable IP Block Alerts in CSF Firewall

To disable IP block alert in CSF firewall, run

Restart lfd and csf

See csf firewall

Ignore a folder in maldet

maldet is malware scanner for linux. On a shared hosting server, maldet detected one cusomer files as malware, on checking i found it is false positive. It is just a log file written by the application. To avoid getting further email from this application, i added this folder to maldet ignore_paths.

To add a folder to ignore list, edit file

Add the folder you need to ignore to end of this file as a new line.

Example

See maldet

Download RPM package from yum repository

To download RPM file from yum repo, you need to install yum-utils package.

Now you can use command

Example

This will download and store all rpm files in /var/yum folder. –resolve will resolve dependency and download them. This will be helpful if you need to install a package on a system with no direct internet connection.

See yum

Enable Passive FTP in ISPConfig

To enable Passive FTP in Debian/Ubuntu installation of ISPConfig, run

Restart pure-ftpd

Now open ports 40110-40210 in firewall.

On CSF Firewall, edit

Add

At ened of TCP_IN line.

Example

See ispconfig

Reorder windows in tmux

To reorder windows in tmux, you can use following command

Press CTRL + B or whatever prefix you use, then press . (dot). This will ask you number/position where you need current window moved.

Another method is

This will give you tmux command promt. Now enter

This will move current window to position 0. This only work if position 0 is empty. If another window already present in position 0, use swap-window command.

This with swap current window with window in position 0.

Another useful command is

This will allow you to rename current tmux window.

Using shortcuts

You can edit .tmux.conf file and add following

Now you can use CTRL + SHIFT + LEFT OR RIGHT arrow to move windows.

See tmux

Setup Tor Hidden Service on CentOS 7

Tor is provided by EPEL repository on CentOS 7. Install EPEL repo with command

Install tor

Edit tor config file

Uncomment or add following lines

Restart tor with command

Now your tor hidden service is ready to use. You need to run your web application on 127.0.0.1:80

To see URL of your tor hidden service, run

Make sure to make a backup of folder “/var/lib/tor/hidden_service/” as it comtains keys for this .onion domain. If you lost it, you will lose your domain name. So it is very important you keep the files safe.

To stop/start tor, run

See tor

tor browser

Tor Hidden Service in Ubuntu/Debian

tor browser

To install tor on Ubuntu/Debian, run

Default configuration file for tor is /etc/tor/torrc

To enable hidden service, edit /etc/tor/torrc

uncomment lines

Create folder for your hidden service

You need to install Apache/Nginx etc.. to serve your web application. Make sure to configure web application listen on 127.0.0.0:80

Now restart tor with command

Ubuntu/Debian support multiple instances of tor. You can use command “/usr/sbin/tor-instance-create” to create new tor instance. Configuration for instanced tor available at /etc/tor/instances/INSTANCE_NAME/torrc

To see URL for your Hidden service, run

Example

You should be able to visit the application using .onion link in Tor Browser.

You need to take backup of tor folder (/var/lib/tor/hidden_service) as it contains your secret keys, this is needed to use the .onion domain name. If you lose this, you will lose the .onion url.

To start the service on boot, run

See Tor