Archive for the ‘Linux & Unix’ Category

How to set a VNC password

Friday, March 20, 2015 posted by admin

The Linux VNC server provides a command to set a new password. The command is "vncpasswd", the password is stored in encrypted form into the file ~/.vnc/passwd of the home directory of te user. Run:

vncpasswd

to set a new password for the currently logged in user. The command will then prompt for the new password. If you like to set a new VNC password for a different user, then append the password file name to the command. Example for the user "jane":

vncpasswd /home/jane/.vnc/passwd

The above command to set a new password for jane requires it that you are logged in as root user. On Ubuntu systems you can use sudo instead:

sudo vncpasswd /home/jane/.vnc/passwd

How to clear bash history

Thursday, March 19, 2015 posted by admin

The Bash hisrory on a linux system is stored in the file .bash_history of the home directory of the user. To clear the history for the currently logged in user, run these commands:

cat /dev/null > ~/.bash_history
history -c

If you like to clear the history of a different user, use these commands. In the example I will cler the history for a user named tom:

cat /dev/null > /home/tom/.bash_history

Please note that you have to be logged in as root user to cler the Bash history of another user or use sudo to execute the command.

sudo cat /dev/null > /home/tom/.bash_history

Here is a list of ports that are used commonly on ISPConfig 3 servers. If you dont have all services installed or if you e.g. dont want to connect to MySQL from external servers, then close the unused or unwanted ports.

TCP ports

20 - FTP Data
21 - FTP Command
22 - SSH
25 - Email
53 - DNS
80 - HTTP (Webserver)
110 - POP3 (Email)
143 -Imap (Email)
443 - HTTPS (Secure webserver)
993 - IMAPS (Secure Imap)
995 - POP3S (Secure POP§)
3306 - MySQL Database server
8080 - ISPConfig web interface
8081- ISPConfig apps vhost

UDP ports

53 - DNS
3306 - MySQL

The Following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System.

Ubuntu Linux

sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

Debian Linux

mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

The benefot of the above comand is that it uses the debian-sys-maint login to MySQL which is available on every Debian and Ubuntu System, so you dont have to provide the MySQL root login details.

How To Disable Error Logging For A Website In ISPConfig 3

Friday, August 8, 2014 posted by admin

To disable the error.log for a website in ISPConfig on a Apache webserver, follow this steps:

1) Login to ISPConfig

2) Go to the website settings of the website were you like to disable the error.log and there go to the "Options tab"

3) Add the following line in the field labeled "Apache Directives"

ErrorLog /dev/null

and press save:

 

How to Copy Files with SCP between Linux Servers

Saturday, July 19, 2014 posted by Till

1.1 SCP Command Line-An Overview

 

The SCP command line is commonly used to copy files over SSH, and between popular Operating systems like Linux, Mac and Windows in a secure fashion. SCP is used to copy files to/from a remote server. It also allows you to copy files from one remote server to another remote server, without passing traffic through your PC.

Solution for: system-config-firewall: command not found

Wednesday, February 5, 2014 posted by admin

When you get the error message "system-config-firewall: command not found" on your CentOS Server while trying to configure the firewall on the shell, then the text interface version of the firewall configuration utility is missing. Install it with this command:

yum install system-config-firewall-tui

If your mail server stops working (neither incoming nor outgoing email works) and you find the following error message in the mail.log file:

fatal: open database /var/lib/postfix/smtpd_scache.db: File exists

then the smtpd_scache.db might got corrupted. Postfix will recreate this file, if it does not exist. So it can be removed to solve the issue:

/etc/init.d/postfix stop
rm -f /var/lib/postfix/smtpd_scache.db
/etc/init.d/postfix start

Thanks to Alexander Fox for sending me this FAQ.

Dovecot is watching the whole server filesystem for modifications and removed or added sub filesystems. If you get errors similar to this one on your server:

Aug 30 09:10:23 server1 dovecot: master: Warning: /var/www/clients/client1/web1/log is no longer mounted. If this is intentional, remove it with doveadm mount

 (the directory path may vary), then you can fix it by excluding the path from being watched by dovecot. In my case, dovecot shall not watch my website directories as they do not contain any mailboxes

Run the following command on the shell as root user:

doveadm mount add '/var/www/*' ignore

To exclude all files and folders in /var/www from deovecot monitoring.

 

Incorrent Time on Windows/Linux Dual Boot System

Monday, April 22, 2013 posted by CSch

If you work on a dual boot system you might experience that when you log off from Windows, onto Linux, and to Windows again, the time that is shown in the bottom right corner might be an hour or more off the actual time. This will correct once you refresh it by loading the time from a time server again but will remain an issue for the next logins.
This has not directly to do with daylight savings or an incorrect time zone, but most likely with Linux assuming that the BIOS time is set to UTC while it's set to local time. So it just changes the BIOS clock according to that. Logging in to Windows with the wrong BIOS clock will result in a wrong system time.

This Linux behavior can easily be changed though, so just login to your Linux system and open a command line. First log in as root with your password:

sudo su

Then enter following to open the rcS file (note that I use vi as text editor - you can use any other you like here):

vi /etc/default/rcS

Now look for the line reading UTC = yes and change it to UTC = no. Save the file and try to boot into Windows - if every other time setting is set correct you should get the right time now.