User Tools

Site Tools


start

This is an old revision of the document!


Κεντρικό Wiki Τμήματος Δ' Πληροφορικης και νέων Τεχνολογιών.


Add ethernet printer in Win10

Control Panel (Windows + R και πληκτρολογώ Control Panel)--> 
Υλικό και ήχος --> 
Προβολή συσκευών και εκτυπωτών -->
Προσθήκη εκτυπωτή -->
Ο εκτυπωτής που αναζητώ δεν βρίσκεται στη λίστα -->
Προσθήκη εκτυπωτή με TCP/IP -->
δίνω IP -->
βρίσκω drivers στον dipeserver (500--> software --> drivers)

ή

Ρυθμίσεις -->
Συσκευές -->
Εκτυπωτές και σαρωτές -->
Προσθήκη εκτυπωτή ή σαρωτή-->
Ο εκτυπωτής που αναζητώ δεν βρίσκεται στη λίστα -->
Προσθήκη εκτυπωτή με TCP/IP -->
δίνω IP -->
βρίσκω drivers στον dipeserver (500--> software --> drivers)

Για να βρείς την IP του εκτυπωτή

Control Panel --> 
Υλικό και ήχος --> 
Προβολή συσκευών και εκτυπωτών -->
Δεξί κλίκ στον εκτυπωτή -->
Ιδιότητες εκτυπωτή -->
Tab Θύρες -->
Ρύθμιση παραμέτρων θύρας

ή

Ρυθμίσεις -->
Συσκευές -->
Εκτυπωτές και σαρωτές -->
Επιλέγω εκτυπωτή -->
Κλικ και Διαχείριση -->
Ιδιότητες εκτυπωτή -->
Tab Θύρες -->
Ρύθμιση παραμέτρων θύρας

Byobu Cheat Sheet

How to close window at byobu?

You can either type exit

How to close all windows Use Byobu's keybinding for killing windows/panes, which is Ctrl-F6

Byobu Commands

      byobu                              Screen manager

Level 0 Commands (Quick Start)


      <F2>                               Create a new window
      <F3>                               Go to the previous window
      <F4>                               Go to the next window
      exit                               Close the current window
      

Level 1 Commands


      <ctrl> a S (capital S, please!)    Split   the  current   region
                                         horizontally  into   two  new
                                         ones
      <ctrl> a |                         Split   the  current  region
                                         vertically into two new ones
      <ctrl> a <tab>                     Go  to  the  next region
      <ctrl> a X (capital X, please!)    Close the current region
      <ctrl> a                           Resize the current  region using the
                                         options given below:
               :resize +N                Increase the  height of  the current
                                         region by N
               :resize -N                Decrease the  height of  the current
                                         region by N
               :resize N                 Set the height of the current region
                                         to N
               :resize =                 Make all regions equally high
               :resize max               Maximize the  height of  the current
                                         region
               :resize min               Minimize the  height of  the current
                                         region
      <ctrl> a x                         Lock the terminal
      <F8>                               Rename the current window

Level 2 Commands (Faster Alternatives)


      <ctrl> a \                         Kill all  the windows  and terminate
                                         the session
                                         This  is  an alternative  to  typing
                                         "exit" in each window
      <ctrl> a <N>                       Go to window number N
                                         This is  an alternative to  the <F3>
                                         and <F4> commands
      <ctrl> a "                         Present  a list  of all  windows for
                                         selection
                                         This is  an alternative to  the <F3>
                                         and <F4> commands
      <ctrl> a <ctrl> a                  Toggle  to the  previously displayed
                                         window
                                         This is  an alternative to  the <F3>
                                         and <F4> commands
      

Help


      1) man screen
      2) <ctrl> a ?
      3) Press <F9>, then choose the "Help" option

F Key Commands


      F2: Create a new window
      F3: Move to the previous window
      F4: Move to the next window
      F5: Refresh all status notifications
      F6: Detach from the session and logout
      Shift-F6: Detach from the session, but do not logout
      F7: Enter scrollback/search mode
      F8: Rename the current window
      F9: Launch the Byobu Configuration Menu
      F12: GNU Screen's Escape Key
      Alt-Pageup: Scroll back through this window's history
      Alt-Pagedown: Scroll forward through this window's history
      Shift-F2: Split the screen horizontally
      Ctrl-F2: Split the screen vertically
      Shift-F3: Move focus to the next split
      Shift-F4: Move focus to the previous split
      Shift-F5: Collapse all splits
      Ctrl-F5: Reconnect any SSH/GPG sockets or agents
      Shift-F12: Toggle all of Byobu's keybindings on or off

Ftp στο dipe.ira.sch.gr

Τα αρχεία του κεντρικού site βρίσκονται ανεβασμένα στο sch.

Με Filezilla

dipe.ira.sch.gr

username: dipeira
password: pV!$75-2

και μπαίνουμε στο φάκελο site

Find Windows 10 Product Key on a New Computer

The product key for new computers that come preinstalled with Windows 10 has the product key stored within the motherboard firmware. Users can retrieve it by issuing a command from the command prompt.

Press Windows key + X
Click Command Prompt (Admin)
At the command prompt, type:
wmic path SoftwareLicensingService get OA3xOriginalProductKey
This will reveal the product key.

Creating a Backup Image Using EaseUS Todo Free

https://askleo.com/creating-backup-image-using-easeus-todo-free/

Restoring an Image Using EaseUS Todo https://askleo.com/restoring-image-using-easeus-todo/

If Win10 activation key of target pc is embedded in bios:

Make an image of the activated Win10 pc -->
Restore the image to the target pc -->
Run cmd as administrator to the target pc -->
Type slmgr.vbs /rearm and press enter -->  
Επανεκκίνηση -->
Run a Windows Update

and the correct embedded to bios key will activate Win10

How to make Byobu function keys to work in PuTTY

Byobu function keys do not work in PuTTY JANUARY 21, 2013

Problem

You are running Byobu on a remote computer to which you have connected using PuTTY. Everything works fine, except that the Byobu commands that use function keys (like F2, F3 and F6 for example) do not work. This problem is caused because the sequences sent by PuTTY for function key press does not match what Byobu expects. This can be fixed easily in PuTTY.

Clean solution

Load the session you use to connect to the remote computer. 
Go to Connection → Data and set the Terminal-type string to putty-256color. 
Save the session.

Dirtier solution

Load the session. Go to Terminal → Keyboard and choose Xterm R6 in the Function keys and keypad section. 
Save the session.

Tried with: PuTTY 0.62 and Byobu 5.17

How to mount a VirtualBox shared folder at startup

Edit /etc/rc.local

sudo -H gedit /etc/rc.local

Before exit 0 type:

mount.vboxsf windows_share /media/windows_share vboxsf

Save

(Optional) Create a shortcut to the desktop or home folder:

ln -s /media/windows_share /home/freddy/Desktop

Script to autostart WebServer VM in dipeserver

location in dipeserver: /etc/init.d/StartVM


### BEGIN INIT INFO
# Provides:          StartVM
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start VM at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO
#! /bin/sh
# /etc/init.d/StartVM
VMUSER=administrator
VMNAME="WebServer"
case "$1" in
start)
echo "Starting VirtualBox VM..."
#sudo -H -b -u $VMUSER /usr/bin/VBoxVRDP -s "$VMNAME"
sudo -H -b -u $VMUSER /usr/bin/VBoxHeadless --startvm "$VMNAME"
;;
stop)
echo "Saving state of Virtualbox VM..."
sudo -H -u  $VMUSER /usr/bin/VBoxManage controlvm "$VMNAME" savestate
;;
*)
echo "Usage: /etc/init.d/StartVM {start|stop}"
exit 1
;;
esac
exit 0

Θέματα Thundirbird

Για να στέλνει ο thunderbird μήνυμα σε mailing list του SCH πρέπει στις ρυθμίσεις λογαριασμού να χρησιμοποιείται το πραγματικό mail (mail@dipe.ira.sch.gr) και όχι το alias (dipeira@sch.gr)

Δηλαδή:

Δεξί κλίκ στο dipeira@sch.gr --> 
Ρυθμίσεις -->
κλίκ στο dipeira@sch.gr -->
Στη Διεύθυνση Email πληκτρολογούμε mail@dipe.ira.sch.gr αντί dipeira@sch.gr

ή

Γραμμή Εργαλείων Μενού --> 
Εργαλεία --> 
Ρυθμίσεις Λογαριασμού-->
κλίκ στο dipeira@sch.gr -->
Στη Διεύθυνση Email πληκτρολογούμε mail@dipe.ira.sch.gr αντί dipeira@sch.gr

Mailing lists του SCH

https://www.sch.gr/lists
(user: dipeira, pass:pV!$75-2)

Εισαγωγή Address Book στο Thunderbird

κλίκ στο Ευρετήριο -->
κλίκ Εργαλεία -->
κλίκ Εισαγωγή -->
κλίκ Ευρετήρια Διευθύνσεων -->
κλίκ Αρχείο Κειμένου (LDIF, .tab, .csv, .txt) -->
κλίκ Επόμενο -->
Επιλέγουμε αρχείο (\\dipeserver\public2\address book)και πατάμε Άνοιγμα

Δ/νση Π.Ε. Ηρακλείου

Ρυθμίσεις --> 
Τοποικοί Φάκελοι --> 
Τοπικός κατάλογος --> 
\\DIPESERVER\email\EMAIL ARCHIVES\mail@dipe.ira.sch.gr

VM Headless Commands

Start
VBoxHeadless --startvm WebServer
stop
VBoxManage controlvm WebServer  poweroff 
savestate
VBoxManage controlvm WebServer  savestate
discardstate
VBoxManage discardstate WebServer
Unlock the VM
vboxmanage startvm WebServer --type emergencystop
Export to Virtual Appliance
VBoxManage export WebServer -o WebServer /mnt/500/backup/WebServerBackup/WebServer.ova
Import to Virtual Appliance
VBoxManage import WebServer.ova
List VMs
VBoxManage list vms

Windows 10 keyboard shortcuts

      Keyboard shortcut	Action
       Windows key	Open or close Start Menu.
       Windows key + A	Open Action center.
       Windows key + C	Open Cortana in listening mode.
       Windows key + D	Display and hide the desktop.
       Windows key + E	Open File Explorer.
       Windows key + G	Open Game bar when a game is open.
       Windows key + H	Open the Share charm.
       Windows key + I	Open Settings.
       Windows key + K	Open the Connect quick action.
       Windows key + L	Lock your PC or switch accounts.
       Windows key + M	Minimize all windows.
       Windows key + R	Open Run dialog box.
       Windows key + S	Open Search.
       Windows key + U	Open Ease of Access Center.
       Windows key + X	Open Quick Link menu.
       Windows key + Number	Open the app pinned to the taskbar in the position indicated by the number.
       Windows key + Left arrow key	Snap app windows left.
       Windows key + Right arrow key	Snap app windows right.
       Windows key + Up arrow key	Maximize app windows.
       Windows key + Down arrow key	Minimize app windows.
       Windows key + Comma	Temporarily peek at the desktop.
       Windows key + Ctrl +D	Add a virtual desktop.
       Windows key + Ctrl + Left or Right arrow	Switch between virtual desktops.
       Windows key + Ctrl + F4	Close current virtual desktop.
       Windows key + Enter	Open Narrator.
       Windows key + Home	Minimize all but the active desktop window (restores all windows on second stroke).
       Windows key + PrtScn	Capture a screenshot and save in Screenshots folder.
       Windows key + Shift + Up arrow	Stretch the desktop window to the top and bottom of the screen.
       Windows key + Tab	Open Task view.
       Windows key + "+" key	Zoom in using the magnifier.
       Windows key + "-" key	Zoom out using the magnifier.
       Ctrl + Shift + Esc	Open Task Manager.
       Alt + Tab	Switch between open apps.
       Alt + Left arrow key	Go back.
       Alt + Right arrow key	Go foward.
       Alt + Page Up	Move up one screen.
       Alt + Page down	Move down one screen.
       Ctrl + Alt +Tab	View open apps
       Ctrl + C	Copy selected items to clipboard.
       Ctrl + X	Cut selected items.
       Ctrl + V	Paste content from clipboard.
       Ctrl + A	Select all content.
       Ctrl + Z	Undo an action.
       Ctrl + Y	Redo an action.
       Ctrl + D	Delete the selected item and move it to the Recycle Bin.
       Ctrl + Esc	Open the Start Menu.
       Ctrl + Shift	Switch the keyboard layout.
       Ctrl + Shift + Esc	Open Task Manager.
       Ctrl + F4	Close the active window.
       Windows key + Pause	Open System Information Panel

[Working] Windows XP Product Keys Free

      CDWVP-GBJRG-PDJRG-Y6CMB-HCGG3
      4X7WM-GTH3D-DWVCV-H382J-HPMRD
      C34VY-TJYXD-3BG2V-HYX8T-76CY6
      TWHCC-DC33F-G4JJP-BTR2B-RKRYT
      CRBH4-MXB2P-HP7V6-8YTMD-CBHJR
      BMYY7-WH8QJ-6MTWG-MXXVQ-MD97B
      G2JMP-2PC7G-RYBYX-PPF38-3KKTY
      HBJFW-XJ7K3-34JDX-VPPTW-227G6
      YXF2Y-QRRKR-BFKVQ-RHQ7H-DJPKD
      VQD7P-3KK7H-M7VV2-CTXM4-MC7FW
      3D2W3-8DJM6-YKQRB-B2XDB-TVQHF
      RXKFJ-67HBV-84TD2-RMDK8-9BDMT

zip_sql

#!/bin/bash
SOURCE=/home/files/db
#BACKUPDIR=/home/files/db/zips
# find & compress all sql files older than 3 days
#find "$SOURCE" -type f -name "*.sql" -mtime +3 -print | xargs tar -czvPf "$BACKUPDIR"/db_`date +\%Y-\%m-\%d-\%H.\%M`.tar.gz 
# delete all sql files older than 3 days
#find "$SOURCE" -type f -name "*.sql" -mtime +3 -print -delete
# delete all sql.gz files older than 14 days
find "$SOURCE" -type f -name "*.sql.gz" -mtime +14 -print -delete

Απογραφή Εισαγωγή - Πρόσληψη

Απογραφή (https://hr.apografi.gov.g)

Μπάινουμε http://winserver/phpmyadmin  -->
Πατάμε dipe_db (βάση δεδομένων Πρωτέα) -->
Επιλέγω Πίνακα ektaktoi (για αναπληρωτές) ή employee (για μονίμους)
Εξαγωγή -->
Κλικ Προσαρμογή - προβολή όλων των πιθανών επιλογών -->
Επιλογή Σύνολο χαρακτήρων του αρχείου: iso-8859-7 -->
Μορφοποίηση: CSV for MS excel -->
Εκτέλεση

ΔΙΑΔΙΚΑΣΙΑ ΕΙΣΑΓΩΓΗΣ

Διαμορφώνουμε το αρχείο excel με 4 στήλες για την διαδικασία της εισαγωγής: ΑΦΜ ΕΠΩΝΥΜΟ ΟΝΟΜΑ ΠΑΤΡΩΝΥΜΟ (Κρατάμε τους τίτλους στην πρωτη γραμμή)

Εισαγωγή υπαλλήλων -->
πρόσληψη πολλαπλών υπαλλήλων μέσω αρχείου Excel -->
Εργασιακή Σχέση (πχ ΙΔΙΩΤΙΚΟΥ ΔΙΚΑΙΟΥ ΟΡΙΣΜΕΝΟΥ ΧΡΟΝΟΥ), 
Εγκριτική Απόφαση (Επιλογή από λίστα κζ για αναπληρωτές ΕΣΠΑ), 
Αιτιολογία (Διορισμός/ Πρόσληψη), 
Επιλογή αρχείου Excel (πρoεπιλεγμένο το sheet1)

Στο φύλλο excel χρειαζόμαστε στήλες με ΑΦΜ, ΕΠΩΝΥΜΟ, ΟΝΟΜΑ, ΠΑΤΡΩΝΥΜΟ Από τα ονόματα αφαιρούμε τα διαλυτικά και τις παύλες αν κάποιος έχει 2 επίθετα. Το ΑΦΜ να είναι σε μορφή text. Το ΑΦΜ να έχει 9 ψηφία. Αν έχει 8 προσθέτουμε στην αρχή το 0.

ΔΙΑΔΙΚΑΣΙΑ ΠΡΟΣΛΗΨΗΣ

Διαμορφώνουμε το αρχείο excel με 2 στήλες για την διαδικασία της εισαγωγής: ΑΦΜ ΕΠΩΝΥΜΟ (Κρατάμε τους τίτλους στην πρωτη γραμμή) (Εισάγουμε τους εκπαιδευτικούς με την ίδια ημ. ανάληψης μαζικά από excel)

(Για εισαγωγή μιας πρόσληψης)

Προσλήψεις -->
Βάζω ΑΦΜ και κάνω Αναζήτηση -->
Πάνω στην επιλεγμένη εγγραφή πατάω ολοκλήρωση -->
Κατηγορία Προσωπικού επιλέγω: ΕΚΠΑΙΔΕΥΤΙΚΟ ΠΡΟΣΩΠΙΚΟ ΠΡΩΤΟΒΑΘΜΙΑΣ ΕΚΠΑΙΔΕΥΣΗΣ -->
Συμπληρώνω ημ. πρόσληψης και ημ. λήξης σύμβασης -->
Επόμενο -->
Ολοκλήρωση -->
Επιστροφή

(Για εισαγωγή πολλών προσλήψεων)

Προσλήψεις -->
Πατάμε Μαζική Ολοκλήρωση Πρόσληψεων -->
Εγκριτική Απόφαση (Επιλογή από λίστα κζ για αναπληρωτές ΕΣΠΑ), 
Εργασιακή Σχέση (πχ ΙΔΙΩΤΙΚΟΥ ΔΙΚΑΙΟΥ ΟΡΙΣΜΕΝΟΥ ΧΡΟΝΟΥ),
Αιτιολογία (Διορισμός/ Πρόσληψη), 
Κατηγορία Προσωπικού επιλέγω: ΕΚΠΑΙΔΕΥΤΙΚΟ ΠΡΟΣΩΠΙΚΟ ΠΡΩΤΟΒΑΘΜΙΑΣ ΕΚΠΑΙΔΕΥΣΗΣ,
Συμπληρώνω ημ. πρόσληψης και ημ. λήξης σύμβασης 
Επιλογή αρχείου Excel (πρoεπιλεγμένο το sheet1)
Επόμενο -->
Ολοκλήρωση -->
Έξοδος

Μεταφορά dipeira site σε localhost

1) Με Ftp συνδέομαι στο σχολικό δίκτυο. (dipeira@dipe.ira.sch.gr)
2) Κατεβάζω τον φάκελο site
3) Μεταφέρω το φάκελο site τοπικά στο /xampp/htdocs
4) Κατεβάζω τη database από το google drive dipeira. Είναι ζιπαρισμένο σε gz.
5) Το μεταφέρω στο /xampp
6) Ανοίγω phpmyadmin και δημιουργώ μια database με όνομα dipeira-db1.
7) Ανοίγω το wp-config.php στο φάκελο /xampp/htdocs/site και όπου DB_USER βάζω root, όπου DB_PASSWORD βάζω τίποτα και όπου DB_HOST βάζω localhost.
8) Από command line στο c:\xampp 
	mysql using mysql -u root -p
	use dipeira-db1
	source filename.gz όπου filename το όνομα αρχείου της backup database που κατεβάσαμε από το google drive dipeira

Μεταφορά γραμμής τηλεφώνου

Πατάω άγκιστρο --> 
εισάγω τριψήφιο εσωτερικό νούμερο --> 
ανακοινώνω την γραμμή (προαιρετικό) --> 
κλείνω γραμμή

Μισθοδοσία Tasks (κάθε μήνα)


Μισθοδοσία Μόνιμων Εκπαιδευτικών & Αναπληρωτών Κρατικού

http://srv1-dipe.ira.sch.gr/misth/

Κάνουμε Login στο http://srv1-dipe.ira.sch.gr/misth/list_users.php -->
κλικ στη "Διαχείριση XML" -->
κλικ "Επιλογή αρχείου" και επιλέγουμε το αρχειο -->
κλικ στο "Ανέβασμα" -->
Πατάμε το κουμπί "Ανάλυση Αρχείων"

Επίσης πηγαίνουμε στις ρυθμίσεις και συμπληρώνουμε ως τελευταία μισθοδοσία τον μήνα που ανεβάσαμε. π.χ. “Μόνιμοι: Σεπτέμβριος 2019”

Το αρχείο το βρίσκουμε στο \\dipeserver\koinos_misthodosias\ΔΙΑΣ\ΒΑΣΗ σε μορφή xml Tip: Τρέχει πάντοτε το directory Monitor ως service και μας ειδοποιεί για τα νέα αρχεία στο \\dipeserver\koinos_misthodosias\ΔΙΑΣ\ΒΑΣΗ


Μισθοδοσία αναπληρωτών ΕΣΠΑ

http://srv1-dipe.ira.sch.gr/espa/

Κάνουμε Login στο https://payroll.espa.minedu.gov.gr/ -->
ΟΠΣΔ Αναπληρωτών και Ωρομισθίων - κλικ στο κουμπί "Είσοδος" -->
κλικ "Μιθοδοσία" --> "Επισκόπηση" -->
Στο Επιλέξτε είδος μισθοδοσίας:(*) βάζουμε "Μηνιαίες Αποδοχές" -->
Στο Επιλέξτε έργο	επιλέγουμε "όλα τα έργα" -->
κλικ "Επόμενη Σελίδα" -->
Στο Επιλέξτε μήνα:(*)	βάζουμε τον τρέχον μήνα -->
κλικ "Εκτύπωση" -->
κλίκ "Εκτύπωση σε Excel (.csv)" -->
κλικ "Επόμενη "Σελίδα" -->
κλικ "Αποθήκευση Αρχείου" -->
κλικ "Κλεισιμο παραθύρου"
Κάνουμε Login στο http://srv1-dipe.ira.sch.gr/espa/ -->
Επιλέγουμε αρχείο (αυτό που αποθηκεύσαμε στο προηγούμενο βήμα) και πατάμε "Ανέβασμα" 

Οικονομικό Tasks (κάθε μήνα) - Ανέβασμα στην Ιστοσελίδα

Άρθρα -->
Βάζω φίλτρο "Στοιχεία εκτέλεσης Προϋπολογισμού Δ/νσης ΠΕ Ηρακλείου" -->
Κλίκ "Φιλτράρισμα" -->
Στο πρώτο άρθρο (το πιο πρόσφατο) πατάμε "Αντίγραψε" (Duplicate Post plugin - Με αυτόν τον τρόπο κλωνοποιούμε το 
post του προηγούμενου μήνα) -->
Αλλάζουμε τον τίτλο του άρθρου στον σωστό μήνα (π.χ. "Στοιχεία εκτέλεσης προϋπολογισμού Δ/νσης Π.Ε. Ηρακλείου – Οκτώβριος 2019")
Σβήνουμε το link με το pdf του προηγούμενου μήνα -->
Drag and Drop στο άρθρο το νέο pdf. -->
Στο νέο παράθυρι εισάγουμε τίτλο για το hyperlink (π.χ. Οκτώβριος 2019) -->
Εισάγουμε το hyperlink (π.χ. http://dipe.ira.sch.gr/site/stoicheia-ektele…akleiou-oct-2019/)
Πατάμε "Εισαγωγή στο άρθρο" -->
Πατάμε "Δημοσίευση"

How to Set Up SSH Keys on Ubuntu 18.04

https://linuxize.com/post/how-to-set-up-ssh-keys-on-ubuntu-1804/

Secure Shell (SSH) is a cryptographic network protocol used for a secure connection between a client and a server and supports various authentication mechanisms.

The two most popular mechanisms are passwords based authentication and public key based authentication. Using SSH keys is more secure and convenient than traditional password authentication.

In this tutorial, we will walk through how to generate SSH keys on Ubuntu 18.04 machines. We will also show you how to set up an SSH key-based authentication and connect to your remote Linux servers without entering a password.

Creating SSH keys on Ubuntu Before generating a new SSH key pair first, check for existing SSH keys on your Ubuntu client machine. You can do that by running the following ls command:

ls -l ~/.ssh/id_*.pub

If the command above prints something like No such file or directory or no matches found it means that you don’t have SSH keys on your client machine and you can proceed with the next step and generate SSH key pair. If there are existing keys, you can either use those and skip the next step or backup up the old keys and generate new ones.

Generate a new 4096 bits SSH key pair with your email address as a comment by typing:

ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"

The output will look something like this:

Enter file in which to save the key (/home/yourusername/.ssh/id_rsa):

Press Enter to accept the default file location and file name.

Next, you’ll be prompted to type a secure passphrase. Whether you want to use passphrase it’s up to you. If you choose to use passphrase you will get an extra layer of security.

Enter passphrase (empty for no passphrase):

If you don’t want to use passphrase just press Enter

To verify your new SSH key pair is generated, type:

ls ~/.ssh/id_*

Output
/home/yourusername/.ssh/id_rsa /home/yourusername/.ssh/id_rsa.pub

Copy the Public Key to Ubuntu Server Now that you generated your SSH key pair, the next step is to copy the public key to the server you want to manage.

The easiest and the recommended way to copy your public key to the server is to use a utility called ssh-copy-id. On your local machine terminal type:

ssh-copy-id remote_username@server_ip_address

You will be prompted to enter the remote_username password:

remote_username@server_ip_address's password:

Once the user is authenticated, the public key ~/.ssh/id_rsa.pub will be appended to the remote user ~/.ssh/authorized_keys file and connection will be closed.

Number of key(s) added: 1

Now try logging into the machine, with: “ssh 'username@server_ip_address'” and check to make sure that only the key(s) you wanted were added.

If by some reason the ssh-copy-id utility is not available on your local computer you can use the following command to copy the public key:

cat ~/.ssh/id_rsa.pub | ssh remote_username@server_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Login to your server using SSH keys After completing the steps above you should be able log in to the remote server without being prompted for a password. To test it just try to login to your server via SSH:

ssh remote_username@server_ip_address

If you haven’t set a passphrase for the private key, you will be logged in immediately. Otherwise, you will be prompted to enter the passphrase.

Disabling SSH Password Authentication To add an extra layer of security to your server you can disable the password authentication for SSH.

Before disabling SSH password authentication make sure you can log in to your server without a password and the user you are logging in with has sudo privileges.

Log into your remote server:

ssh sudo_user@server_ip_address

Open the SSH configuration file /etc/ssh/sshd_config with your text editor:

sudo nano /etc/ssh/sshd_config

Search for the following directives and modify as it follows:

PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

Once you are done save the file and restart the SSH service by typing:

sudo systemctl restart ssh

At this point, the password-based authentication is disabled.

Conclusion In this tutorial, you have learned how to generate a new SSH key pair and set up an SSH key-based authentication. You can add the same key to multiple remote servers. We have also shown you how to disable SSH password authentication and add an extra layer of security to your server.

By default, SSH listens on port 22. Changing the default SSH port will reduce the risk of automated attacks.

If you are regularly connecting to multiple systems, you can simplify your workflow by defining all of your connections in the SSH config file.

Importing a large sql file into mysql

(if you can't import a large sql file with phpmyadmin tool)

You have to run the following command:

mysql -u <user> -p<password> dbname < filename.sql

Another alternate is:

log in to mysql using mysql -u <user> -p
mysql > use db_name;
mysql > source filename.sql;

OpenVpn Server Installation

Open port 1194

Open the OpenVPN Port and Enable the Changes We'll adjust the firewall itself to allow traffic to OpenVPN.

If you did not change the port and protocol in the /etc/openvpn/server.conf file, you will need to open up UDP traffic to port 1194.

We'll also add the SSH port in case you forgot to add it when following the prerequisite tutorial:

sudo ufw allow 1194/udp
sudo ufw allow OpenSSH

Now, we can disable and re-enable UFW to load the changes from all of the files we've modified:

sudo ufw disable
sudo ufw enable

Our server is now configured to correctly handle OpenVPN traffic.

We need a static IP for the machine that runs the server or a ddns service. For ddns:

subscribe to no-ip.net
configure route with no-ip account and connect
use port forwarding option from router to open port 1194 for the pc (we need the ip) that runs the openvpn server (The pc must have a local fixed ip - one way to do it is from DHCP--> adrress reservation option of the router)

OpenVPN server in a Docker container complete with an EasyRSA PKI CA https://github.com/kylemanna/docker-openvpn

Systemd Init Scripts A systemd init script is available to manage the OpenVPN container. It will start the container on system boot, restart the container if it exits unexpectedly, and pull updates from Docker Hub to keep itself up to date. https://github.com/kylemanna/docker-openvpn/blob/master/docs/systemd.md


To stop the vpn client from redirecting all internet traffic through vpn

docker-openvpn @ dipeira

https://github.com/kylemanna/docker-openvpn

- Follow the instructions @ Quick Start.

- Replace ovpn_genconfig line with

docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_genconfig -N -d -u udp://srv1-dipe.ira.sch.gr -p "route 10.9.251.0 255.255.255.0" -p "route 192.168.255.0 255.255.255.0"

- Make openvpn container persistent on reboots:

docker run -v $OVPN_DATA:/etc/openvpn --restart always -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

password for creating ovpn files for clients: ira.dipe

How to Setup Let’s Encrypt SSL on Ubuntu 18.04 & 16.04 LTS

WebServer-Backup.sh

#!/bin/bash
### Script to take backup of the WebServer VM ###

BACKUPDIR=/mnt/500/backup/WebServerBackup

### Save the Virtual Machine state ###
echo "Saving the VM state..."
VBoxManage controlvm WebServer savestate && echo "OK" || exit
sleep 3

### Create the Virtual Appliance with timestamp ###
echo "Creating the Virtual Appliance..."
VBoxManage export WebServer -o "$BACKUPDIR"/WebServer_`date +\%Y-\%m-\%d-\%H.\%M`.ova && echo "OK" || echo "Failed"
sleep 3

### Erasing ova files older than 8 days ###
echo "Erasing older ova files ..."
find "$BACKUPDIR" -type f -name "*.ova" -mtime +7 -print -delete && echo "OK" || echo "Failed"
sleep 3

### Start the  Virtual Machine ###
echo "Starting the Virtual Virtual Machine..."
VBoxHeadless --startvm WebServer && echo "OK" || echo "Failed"

### Use crontab -e to create a cronjob to execute this script every Monday and Thursday at 02:00###
### 0 2 * * 1,4 /home/administrator/"VirtualBox VMs"/WebServer-Backup.sh ###
start.1578397438.txt.gz · Last modified: 2020/01/07 13:43 by kotsimp