Skip to main content

Posts

Showing posts with the label Networking

ISPConfig 3 configuration file

ISPConfig 3 has two different configuration files, one for the server part and one for the interface. Interface: /usr/local/ispconfig/interface/lib/config.inc.php Server: /usr/local/ispconfig/server/lib/config.inc.php The mysql root password which is only used to create new mysql databases is stored in the file: /usr/local/ispconfig/server/lib/mysql_clientdb.conf

How to change ISPConfig admin user password

In order to change ISPConfig administrator password you will have to connect to your MySQL using the command line. It can be done using the following command: mysql -u root -p[yourrootpassword] After that select the database called " dbispconfig ". This can be done using the following command: use dbispconfig;  - selects the MySQL database called " dbispconfig " Finnally execute the following command to change password : UPDATE sys_user SET passwort = md5('NEWPASSWORD') WHERE username = 'admin';  - enter your desired password where text "NEWPASSWORD" is present. After that simply connect to your ISPConfig using new admin password!

Bring back deleted files with lsof

There you are, happily playing around with an audio file you've spent all afternoon tweaking, and you're thinking, "Wow, doesn't it sound great? Lemme just move it over here." At that point your subconscious chimes in, "Um, you meant  mv , not  rm , right?" Oops. I feel your pain -- this happens to everyone. But there's a straightforward method to recover your lost file, and since it works on every standard Linux system, everyone ought to know how to do it. Briefly, a file as it appears somewhere on a Linux filesystem is actually just a link to an  inode , which contains all of the file's properties, such as permissions and ownership, as well as the addresses of the data blocks where the file's content is stored on disk. When you  rm  a file, you're removing the link that points to its inode, but not the inode itself; other processes (such as your audio player) might still have it open. It's only after they're through and all link...

15 Linux lsof Command Examples (Identify Open Files)

lsof stands for List Open Files. It is easy to remember lsof command if you think of it as "ls + of", where ls stands for list, and of stands for open files. It is a command line utility which is used to list the information about the files that are opened by various processes. In unix, everything is a file, ( pipes, sockets, directories, devices, etc.). So by using lsof, you can get the information about any opened files. 1. Introduction to lsof Simply typing lsof will provide a list of all open files belonging to all active processes. # lsof COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 root cwd DIR 8,1 4096 2 / init 1 root txt REG 8,1 124704 917562 /sbin/init init 1 root 0u CHR 1,3 0t0 4369 /dev/null init 1 root 1u CHR 1,3 0t0 4369 /dev/null init 1 root 2u CHR ...

Maximum Upload File Size

Maximum Upload File Size   Is there an easy way to increase the maximum file upload size (currently 2 megabytes)?  The file upload size is set in your PHP configuration,  php.ini , with the parameter  upload_max_filesize . The setting can be changed in a number of different places depending on your webserver and the method it uses to run PHP. If your Webserver allows the modification of PHP settings through a  .htaccess  file (Apache + mod_php) add the following two lines to a  .htaccess  in the installed directory: php_value upload_max_filesize 15M php_value post_max_size 15M Otherwise you need to modify your  php.ini  (usually located in  /etc/php5/php.ini , but refer to your administrator or distribution manual for the correct location): upload_max_filesize = 15M post_max_size = 15M After modifying the global  php.ini  you will need to restart the webserver to have changes take effect. Apache U...

Shell In A Box SSH Via Web Browser

This is tutorial that i read today. It's about how to remote your computer via web. It use web based emulator named shellinabox  created by Markus Gutschke .  It has built-in web server that runs as a web-based  SSH client  on a specified  port  and prompt you a web terminal emulator to access and control your  Linux Server SSH Shell  remotely using any  AJAX / JavaScript  and  CSS   enabled browsers This tutorial  describe how to install  Shellinabox  and access remote  SSH terminal  using a modern web browser on any machine.

How To Disable IPV6 in Ubuntu

I want to  disable  ipv6  in my Ubuntu Server. First, I open  /etc/sysctl.conf  using  text editor. $ sudo nano /etc/sysctl.conf Then I  insert these following lines at the end. net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 After that, I save the file using Ctrl+O and exit from text editor using Ctrl+X. On terminal, I type this command  $ sudo sysctl -p I get result in terminal as, net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 After that when I check, $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6 I get result as, 1 From the result, I know my  ipv6 disabled  successfully.

How to install rsync server on CentOS

These are steps to install rsync server.  Install xinetd and rsync packages #yum -y install xinetd rsync Then make sure xinetd is running on levels 3, 4 and 5 #chkconfig --level 345 xinetd on Modify rsync xinetd configuration. We shoud change disable = yes to disable = no #vi /etc/xinetd.d/rsync Next, create rsync secrets file for password with format of username:password #vi /etc/rsyncd.secrets Last create configuration for rsync shares #vi /etc/rsyncd.conf Fill this configuration # rsyncd.conf secrets file = /etc/rsyncd.secrets motd file = /etc/rsyncd.motd read only = yes list = yes uid = nobody gid = nobody [out] comment = Interesting stuff from this server path = /home/rsync/out [confidential] comment = FYI path = /home/rsync/secret-out auth users = demby,pratama hosts allow = *. pratama.us hosts deny = * list = false  Then save After that, fix up permission and ownership file, and restart ...

Website Using HTTPS Protocol

Last week, I changed protocol of my website from http to https. There were steps that i had to do. First, I installed openssl package and mod_ssl # yum install mod_ssl openssl Then, I configured the openssl  and created certificate # cd /etc/pki/tls/certs # make server.key # openssl rsa -in server.key -out server.key # make server.csr # openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650 # chmod 400 server.* After that, I changed configuration of httpd/apache #nano /etc/httpd/conf.d/ssl.conf DocumentRoot "/var/www/html" ServerName www.server.world:443 SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/certs/server.key Last, I restarted the webserver #service httpd restart That's all what i did last week to change my website protocol from http to https.

How to fix Apache – "Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName" Error on Ubuntu

While restarting the Apache server on Ubuntu, I have this problem. pratama@pratama:~$ sudo /etc/init.d/apache2 restart * Restarting web server apache2                                                apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName To fix that problem, I need to edit the httpd.conf file. Open the terminal and type, sudo nano /etc/apache2/httpd.conf By default httpd.conf file will be blank. Now, simply I add the following line to the file. ServerName PratamaServer Then I save the file (Ctrl+O) and exit (Ctrl+X) from nano. Finally restart the server. sudo /etc/init.d/apache2 restart

Enable compression on Apache Centos/Fedora

Make sure your mod_deflate is enable. Check file httpd.conf : nano /etc/httpd/httpd.conf Find this : LoadModule deflate_module modules/mod_deflate.so Create /etc/httpd/conf.d/deflate.conf with the following contents  # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary # Don't compress already compressed stuff ! SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary # Log Stuff ! #DeflateFilterNote Input input_info #DeflateFilterNote Output output_info #DeflateFil...

apt-get behind proxy

We can use apt-get behind proxy. We should place proxy on bashrc. #nano /etc/bash.bashrc Tambahkan export http_proxy http://username:password@proxy.polsri.ac.id:8080/ export ftp_proxy http://username:password@proxy.polsri.ac.id:8080/

SCP How To

There are many software that can be use to transfer file. Many people use File Transfer Protocol to transfer file between computers. If you use Operating System Linux, you can use scp. scp is used for copying file from local to remote host securely. It uses ssh for data transfer and provides the same authentication and same level of security as ssh. If you want to copy a file from a remote host to the local host: scp user@remotehost.com:filename /path/local/directory If you want to copy a file from the local host to a remote host: scp /path/local/directory user@remotehost.com:filename If you want to copy a directory from local host to a remote host scp -r /path/local/directory user@remotehost.com:/path/remote/directory If you want to copy a directory from remote host to a local host scp -r user@remotehost.com:/path/remote/directory /path/local/directory If you want to copy a file from remote host 1 to remote host 2 (copy file between remote host) scp user@remotehost1.com:/path/remote/...

Yahoo Messenger Port

Ports Yahoo! Messenger uses! Yahoo! Messenger services uses a variety of ports. These are list of ports Chat & Messenger TCP Port 5050: Client Access only Insider/Room Lists TCP Port 80: Client Access only File Transfer TCP Port 80: Server Access. Your ISP may block this port, as its used for web hosting. You can change port in Messenger, Preferences, File Transfer. Voice Chat UDP 5000-5010 TCP 5000-5001: Client Access If UDP Fails, TCP will be used instead, see below. WebCam TCP Port 5100: Client Access Super Webcam TCP Port 5100: Server Access P2P Instant Messages TCP Port 5101: Server Access PMs between Buddys may not use the Yahoo! Server, but this is not a requirement.

Backup Mysql Database

This tip would be useful for those who are either making backup of their remote mysql database or moving their web hosting to their provider. Here’s how to export mysql DB to SQL file using command-line utility : mysqldump –user=username –password=1234 –databases your_database –opt –quote-names –complete-insert > example.sql or you can use this command : $ mysql -u username -p dbname > database.sql If the MySQL programs are not in your path, you will need to manually specify the location of the mysqldump program: $ /usr/local/mysql/bin/mysqldump -u username -p --opt dbname > database.sql Download the database.sql and keep it in a safe place (CDR, Zip disk, etc). If you need to restore your database, you can do so like this: $ mysql -u username -p databasename

Optimize Wordpress

Optimize your website is important steps after you made it. If you build your website using wordpress, i found three steps to optimize it. First Step – Optimize 1) Upgrade to latest WordPress release 2) Delete all the unused or unwanted plugins (this is the first reason why you need 10-12 seconds to load your homepage). 3) Clean up your css code using a css compressor like styleneat, cleancss or csstidyonline. 4) Reduce the PHP and database queries. For example, on your header, use absolute URLs (http://www.yourdomain.com/wp-content/themes/example/style.css instead of ). Second Step – Install some plugins After that you can install 6 ‘magic’ plugins: 5) WP Super-Cache (to cache all the dynamic requests as static html files). 6) WP Tuner (to analyze your database and to find slow queries or plugins). 7) WP Smush.it (to reduce image file sizes using Smush.it) 8) WP-DBManager (again, to optimize and repair the database) 9) Disable Revisions and Autosave (every time you change a post you c...

Install DHCP Server

Last week i need to install dhcp on my server. My server use Linux Ubuntu 8.04 as an operating system. These are the steps : 1. Install DHCP3 Server sudo apt-get install dhcp3-server 2. Edit Configuration of DHCP sudo nano /etc/dhcp3/dhcpd.conf This is the configuration of /etc/dhcpd.conf # Sample /etc/dhcpd.conf # (add your comments here) default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name "mydomain.example"; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; range 192.168.1.150 192.168.1.200; } Save this configuration using Ctrl+O and Exit using Ctrl+X. This configuration will result in the DHCP server giving a client an IP address from the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for 600 seconds if the client doesn't ask for ...

25 Best SSH Tricks and Commands Part 2

Another ssh tricks you shoud know are : 11) Port Knocking! knock 3000 4000 5000 && ssh -p user@host && knock 5000 4000 3000 Knock on ports to open a port to a service (ssh for example) and knock again to close the port. You have to install knockd. See example config file below. [options] logfile = /var/log/knockd.log [openSSH] sequence = 3000,4000,5000 seq_timeout = 5 command = /sbin/iptables -A INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn [closeSSH] sequence = 5000,4000,3000 seq_timeout = 5 command = /sbin/iptables -D INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn 12) Remove a line in a text file. Useful to fix ssh-keygen -R In this case it’s better do to use the dedicated tool 11) Port Knocking! knock 3000 4000 5000 && ssh -p user@host && knock 5000 4000 3000 Knock on ports to open a port to a service (ssh for example) and knock again to close the port. You have to install knockd. See example config file below. [o...

25 Best SSH Tricks and Commands Part 1

OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions. SSH is an awesome powerful tool, there are unlimited possibility when it comes to SSH, heres the top Voted SSH commands 1) Copy ssh keys to user@host to enable password-less ssh logins. ssh-copy-id user@host To generate the keys use the command ssh-keygen 2) Start a tunnel from some machine’s port 80 to your local post 2001 ssh -N -L2001:localhost:80 somemachine Now you can acces the website by going to http://localhost:2001/ 3) Output your microphone to a remote computer’s speaker dd if=/dev/dsp...

Detect And Block Port Scan Attacks In Real Time

A port scanner (such as nmap) is a piece of software designed to search a network host for open ports. Cracker can use nmap to scan your network before starting attack. You can always see scan patterns by visiting /var/log/messages. But, I recommend the automated tool called psad - the port scan attack detector under Linux which is a collection of lightweight system daemons that run on Linux machines and analyze iptables log messages to detect port scans and other suspicious traffic. psad makes use of Netfilter log messages to detect, alert, and (optionally) block port scans and other suspect traffic. For tcp scans psad analyzes tcp flags to determine the scan type (syn, fin, xmas, etc.) and corresponding command line options that could be supplied to nmap to generate such a scan. In addition, psad makes use of many tcp, udp, and icmp signatures contained within the Snort intrusion detection system. Install psad under Debian / Ubuntu Linux Type the following command to install psad, en...