Category : Linux

Connect to VPN from Linux

Install an OpenVPN client: Fedora/CentOS/RedHat: yum install openvpn Ubuntu/Debian: apt-get install openvpn In general, the easiest way to install an OpenVPN client is to use the –config argument to specify the location of the client config file: openvpn –config client.ovpn

SSL Certificates with Apache 2 on CentOS

Generate a Self-Signed Certificate At the shell prompt, issue the following commands to install SSL for Apache and generate a certificate: yum install mod_ssl mkdir /etc/httpd/ssl openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/httpd/ssl/httpd.pem -keyout /etc/httpd/ssl/httpd.key Configure Apache to use the Self-Signed Certificate NameVirtualHost *:443 SSLEngine On SSLCertificateFile /etc/httpd/ssl/httpd.pem SSLCertificateKeyFile /etc/httpd/ssl/httpd.key ServerAdmin

Read More →

Tar and untar files and folders

tar tar files tar cvf dest.tar file.txt file2.txt Tarring folders tar cvf dest.tar myfolder/ Untar the file or folder tar xvf dest.tar tar.gz Compress using gzip: tar cvfz dest.tar.gz myfolder/ Uncompress zip file: tar xvfz dest.tar.gz tar cvjf dest.tar.bz2 myfolder/ Extract: tar xvjf dest.tar.bz2 Extracting individual files tar xvjf dest.tar.bz2 textfile.txt

Ubuntu – Executing a script at startup and shutdown

To execute a script at startup of Ubuntu Edit /etc/rc.local and add your commands The script must always end with exit 0 To execute a script upon rebooting Ubuntu: Put your script in /etc/rc0.d Make it executable (sudo chmod +x myscript) Note: The scripts in this directory are executed in alphabetical order The name of

Read More →

Linux – chown directory for multiple users

Create a new group for users (run commands with root rights): groupadd testgroup gpasswd -a user1 testgroup gpasswd -a user2 testgroup gpasswd -a user3 testgroup … Make that group the group owner of the directory (with root rights): chown -R user1:testgroup /your/directory Make the group writeable (with root rights): chmod -R g+w /your/directory