Linux





Jak se přihlásit jako root bez znalosti hesla.

Je velmi snadné jak to udělat
Nabootujte do "grub", vyberte "single user", ale nemačkejte "Enter".
Zmáčkněte "e" a vstupte do editačního módu.
Scrolujte dolů až na řádek s kernelem, s kterého se bootuje bude začínat "linux /boot/vmlinuz-……."
skočte na konec řádku, udělejte mezeru a napište init=/bin/bash
Zmáčkněte CTRL + X a nabootujte

# Remount / as Read/Write
mount -rw -o remount /
# Change the root account password with
passwd
# Change any other account password with
passwd username
# type new password, confirm and hit enter and then reboot.

Apache2 With PHP 7.1 Support On Ubuntu 18.04 LTS Server

Step 1: Install Apache2 Web Server
sudo apt install apache2
After installing Apache2, the commands below can be used to stop, start, reload and enable Apache2 service to always startup when the server boots up.
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl reload apache2.service
sudo systemctl enable apache2.service

Step 2: Install PHP And Related Modules
PHP 7.1 may not be available in Ubuntu default repositories… in order to install it, you will have to get it from third-party repositories. Run the commands below to add the below third party repository to upgrade to PHP 7.1
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
Then update and upgrade to PHP 7.1
sudo apt update
Finally, run the commands below to install PHP 7.1 and related modules.. sudo apt-get install php7.1 libapache2-mod-php7.1 php7.1-mcrypt php7.1-cli php7.1-xml php7.1-zip php7.1-mysql php7.1-gd php7.1-imagick php7.1-recode php7.1-tidy php7.1-xmlrpc

How to install VMware Tools on Debian 9

Step 1: Install Apache2 Web Server 
su uname -r apt-get install build-essential linux-headers-UNAME RESULT for me apt-get install build-essential linux-headers-4.9.0-8-amd64 mount /dev/cdrom /media/cdrom cd /media/cdrom cp VMwareTools-your version /tmp cd /tmp tar zxvf VMwareTools-your version cd vmware-tools-distrib/ ./vmware-install.pl if you will have error "What is the location of the ifconfig" ... Install net-tools su apt-get install net-tools Then re-run vmware-install.pl

How to protect GRUB by password

Create your password by typing
# grub-mkpasswd-pbkdf2

Enter your password.
This will generate a long and encrypted password.

Copy the whole generated code and Edit the file

/etc/grub.d/00_header using vi, leafpad, nano e.g
# vi /etc/grub.d/00_header
or
# sudo leafpad /etc/grub.d/00_header

Go to the end of the file.

Type the following command

cat << EOF
set superusers="username"
password_pbkdf2 username 'paste the generated code copied above here'
EOF

Save the changes and exit the editor & update grub using either of the commands

# update-grub
or
# grub-mkconfig -o /boot/grub/grub.cfg

To test the changes, reboot the system. 
If the procedure above was successful, once you select grub entry to boot, you will be prompted to enter username and password. 
Enter those credentials and your grub is secured!!!!

How change what’s displayed before login to shell or after

Before login
The text displayed before the login prompt is stored in /etc/issue 

After login
The text displayed after login is stored in /etc/motd, 

It's just a normal text file, but it accepts many of escape sequences:

4{ethernet adapter} - IP4 address f.eks 4{eth0}
6{ethernet adapter} - IP6 address
b -- Baudrate of the current line.
d -- Current date.
s -- System name, the name of the operating system.
l -- Name of the current tty line.
m -- Architecture identifier of the machine, eg. i486
n -- Nodename of the machine, also known as the hostname.
o -- Domainname of the machine.
r -- Release number of the OS, eg. 1.1.9.
t -- Current time.
u -- Number of current users logged in.
U -- The string "1 user" or " users" where is the number of current users logged in.
v -- Version of the OS, eg. the build-date etc.

Uninstalling MySQL

Use apt to uninstall and remove all MySQL packages:

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean

How to compress PDF File, reduce size

sudo
apt-get install ghostscript
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf


How to install and use CertBot

1. Install CertBot
To install Certbot, simply run the following commands:

apt-get install software-properties-common python-software-properties
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-apache

2. Install Let’s Encrypt SSL Certificate
To install a Let’s Encrypt SSL certificate on your domain, execute the following command (make sure you replace ‘yourdomain.com’ with your actual domain name):

certbot --apache -d yourdomain.com

You will then be asked for an email address and to read and accept the Terms of Services. This is how the output should look like during the installation:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): admin@yourdomain.com

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: Y

Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for yourdomian.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/000-default-le-ssl.conf
Deploying Certificate for yourdomain.com to VirtualHost /etc/apache2/sites-available/000-default-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/000-default-le-ssl.conf
3. Redirect HTTP to HTTPS
Additionally, you can also make a choice if you would like to redirect all the HTTP traffic to HTTPS:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-available/000-default-le-ssl.conf

-------------------------------------------------------------------------------
Congratulations! You have successfully enabled https://yourdomain.com
4. Automatic renewal
You can also create a cron job in order to set up an automatic SSL renewal. To do this first run:

crontab -e
and then add the following:

 /usr/bin/letsencrypt renew >> /var/log/letsencrypt-renew.log
Save the file and close it. Restart the cron service so the changes can take effect:

service cron restart
That’s it.


How to install ISPConfig Debian 9

cd /tmp

wget –no-check-certificate -O installer.tgz “https://github.com/servisys/ispconfig_setup/tarball/master”

tar zxvf installer.tgz

cd ispconfig

bash install.sh


Microsoft Exchange SAN UCC SSL

Leave a Reply

Your email address will not be published. Required fields are marked *