start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
start [2019/12/12 13:16] – [WebServer-Backup.sh] kotsimp | start [2020/03/17 22:58] (current) – kotsimp | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Κεντρικό Wiki Τμήματος Δ' Πληροφορικης και νέων Τεχνολογιών. ====== | ====== Κεντρικό 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' | ||
- | |||
- | |||
- | |||
- | |||
- | Byobu Commands | ||
- | |||
- | byobu Screen manager | ||
- | |||
- | |||
- | Level 0 Commands (Quick Start) | ||
- | ------------------------------ | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | exit Close the current window | ||
- | | ||
- | |||
- | Level 1 Commands | ||
- | ---------------- | ||
- | |||
- | < | ||
- | | ||
- | ones | ||
- | < | ||
- | | ||
- | < | ||
- | < | ||
- | < | ||
- | | ||
- | : | ||
- | | ||
- | : | ||
- | | ||
- | : | ||
- | to N | ||
- | : | ||
- | : | ||
- | | ||
- | : | ||
- | | ||
- | < | ||
- | < | ||
- | |||
- | |||
- | Level 2 Commands (Faster Alternatives) | ||
- | -------------------------------------- | ||
- | |||
- | < | ||
- | the session | ||
- | | ||
- | " | ||
- | < | ||
- | This is an alternative to the <F3> | ||
- | and <F4> commands | ||
- | < | ||
- | | ||
- | This is an alternative to the <F3> | ||
- | and <F4> commands | ||
- | < | ||
- | | ||
- | This is an alternative to the <F3> | ||
- | and <F4> commands | ||
- | | ||
- | |||
- | Help | ||
- | ---- | ||
- | |||
- | 1) man screen | ||
- | 2) < | ||
- | 3) Press <F9>, then choose the " | ||
- | |||
- | |||
- | |||
- | 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/ | ||
- | |||
- | F8: Rename the current window | ||
- | |||
- | F9: Launch the Byobu Configuration Menu | ||
- | |||
- | F12: GNU Screen' | ||
- | |||
- | Alt-Pageup: Scroll back through this window' | ||
- | |||
- | Alt-Pagedown: | ||
- | |||
- | 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' | ||
- | ===== 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:// | ||
- | |||
- | Restoring an Image Using EaseUS Todo | ||
- | https:// | ||
- | |||
- | |||
- | |||
- | 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 / | ||
- | |||
- | sudo -H gedit / | ||
- | Before exit 0 type: | ||
- | |||
- | mount.vboxsf windows_share / | ||
- | Save | ||
- | |||
- | (Optional) Create a shortcut to the desktop or home folder: | ||
- | |||
- | ln -s / | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== Script to autostart WebServer VM in dipeserver ===== | ||
- | |||
- | |||
- | location in dipeserver: / | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | ### BEGIN INIT INFO | ||
- | # Provides: | ||
- | # Required-Start: | ||
- | # Required-Stop: | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # Short-Description: | ||
- | # Description: | ||
- | ### END INIT INFO | ||
- | #! /bin/sh | ||
- | # / | ||
- | VMUSER=administrator | ||
- | VMNAME=" | ||
- | case " | ||
- | start) | ||
- | echo " | ||
- | #sudo -H -b -u $VMUSER / | ||
- | sudo -H -b -u $VMUSER / | ||
- | ;; | ||
- | stop) | ||
- | echo " | ||
- | sudo -H -u $VMUSER / | ||
- | ;; | ||
- | *) | ||
- | echo " | ||
- | 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:// | ||
- | (user: dipeira, pass: | ||
- | |||
- | ************************************************************************************ | ||
- | |||
- | |||
- | Εισαγωγή 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 | ||
- | |||
- | savestate | ||
- | VBoxManage controlvm WebServer | ||
- | |||
- | discardstate | ||
- | VBoxManage discardstate WebServer | ||
- | |||
- | Unlock the VM | ||
- | vboxmanage startvm WebServer --type emergencystop | ||
- | |||
- | |||
- | Export to Virtual Appliance | ||
- | VBoxManage export WebServer -o WebServer / | ||
- | |||
- | Import to Virtual Appliance | ||
- | VBoxManage import WebServer.ova | ||
- | |||
- | List VMs | ||
- | VBoxManage list vms | ||
- | ===== Windows 10 keyboard shortcuts ===== | ||
- | Keyboard shortcut Action | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | 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. | ||
- | | ||
- | |||
- | |||
- | ===== [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=/ | ||
- | # | ||
- | # find & compress all sql files older than 3 days | ||
- | #find " | ||
- | # delete all sql files older than 3 days | ||
- | #find " | ||
- | # delete all sql.gz files older than 14 days | ||
- | find " | ||
- | |||
- | ===== Απογραφή Εισαγωγή - Πρόσληψη ===== | ||
- | |||
- | Απογραφή (https:// | ||
- | |||
- | Μπάινουμε http:// | ||
- | Πατάμε dipe_db (βάση δεδομένων Πρωτέα) --> | ||
- | Επιλέγω Πίνακα ektaktoi (για αναπληρωτές) ή employee (για μονίμους) | ||
- | Εξαγωγή --> | ||
- | Κλικ Προσαρμογή - προβολή όλων των πιθανών επιλογών --> | ||
- | Επιλογή Σύνολο χαρακτήρων του αρχείου: | ||
- | Μορφοποίηση: | ||
- | Εκτέλεση | ||
- | |||
- | |||
- | ΔΙΑΔΙΚΑΣΙΑ ΕΙΣΑΓΩΓΗΣ | ||
- | |||
- | Διαμορφώνουμε το αρχείο 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 τοπικά στο / | ||
- | 4) Κατεβάζω τη database από το google drive dipeira. Είναι ζιπαρισμένο σε gz. | ||
- | 5) Το μεταφέρω στο /xampp | ||
- | 6) Ανοίγω phpmyadmin και δημιουργώ μια database με όνομα dipeira-db1. | ||
- | 7) Ανοίγω το wp-config.php στο φάκελο / | ||
- | 8) Από command line στο c: | ||
- | mysql using mysql -u root -p | ||
- | use dipeira-db1 | ||
- | source filename.gz όπου filename το όνομα αρχείου της backup database που κατεβάσαμε από το google drive dipeira | ||
- | |||
- | ===== Μεταφορά γραμμής τηλεφώνου ===== | ||
- | |||
- | Πατάω άγκιστρο --> | ||
- | εισάγω τριψήφιο εσωτερικό νούμερο --> | ||
- | ανακοινώνω την γραμμή (προαιρετικό) --> | ||
- | κλείνω γραμμή | ||
- | |||
- | ===== Μισθοδοσία Tasks (κάθε μήνα) ===== | ||
- | |||
- | ----------------------------------------------------------------------- | ||
- | |||
- | Μισθοδοσία Μόνιμων Εκπαιδευτικών & Αναπληρωτών Κρατικού | ||
- | |||
- | http:// | ||
- | |||
- | Κάνουμε Login στο http:// | ||
- | κλικ στη " | ||
- | κλικ " | ||
- | κλικ στο " | ||
- | Πατάμε το κουμπί " | ||
- | |||
- | Επίσης πηγαίνουμε στις ρυθμίσεις και συμπληρώνουμε ως τελευταία μισθοδοσία τον μήνα που ανεβάσαμε. π.χ. " | ||
- | |||
- | Το αρχείο το βρίσκουμε στο \\dipeserver\koinos_misthodosias\ΔΙΑΣ\ΒΑΣΗ σε μορφή xml | ||
- | Tip: Τρέχει πάντοτε το directory Monitor ως service και μας ειδοποιεί για τα νέα αρχεία στο \\dipeserver\koinos_misthodosias\ΔΙΑΣ\ΒΑΣΗ | ||
- | ------------------------------------------------------------------------ | ||
- | |||
- | Μισθοδοσία αναπληρωτών ΕΣΠΑ | ||
- | |||
- | http:// | ||
- | |||
- | Κάνουμε Login στο https:// | ||
- | ΟΠΣΔ Αναπληρωτών και Ωρομισθίων - κλικ στο κουμπί " | ||
- | κλικ " | ||
- | Στο Επιλέξτε είδος μισθοδοσίας: | ||
- | Στο Επιλέξτε έργο επιλέγουμε " | ||
- | κλικ " | ||
- | Στο Επιλέξτε μήνα: | ||
- | κλικ " | ||
- | κλίκ " | ||
- | κλικ " | ||
- | κλικ " | ||
- | κλικ " | ||
- | |||
- | Κάνουμε Login στο http:// | ||
- | Επιλέγουμε αρχείο (αυτό που αποθηκεύσαμε στο προηγούμενο βήμα) και πατάμε " | ||
- | | ||
- | ===== Οικονομικό Tasks (κάθε μήνα) - Ανέβασμα στην Ιστοσελίδα ===== | ||
- | |||
- | Άρθρα --> | ||
- | Βάζω φίλτρο " | ||
- | Κλίκ " | ||
- | Στο πρώτο άρθρο (το πιο πρόσφατο) πατάμε " | ||
- | post του προηγούμενου μήνα) --> | ||
- | Αλλάζουμε τον τίτλο του άρθρου στον σωστό μήνα (π.χ. " | ||
- | Σβήνουμε το link με το pdf του προηγούμενου μήνα --> | ||
- | Drag and Drop στο άρθρο το νέο pdf. --> | ||
- | Στο νέο παράθυρι εισάγουμε τίτλο για το hyperlink (π.χ. Οκτώβριος 2019) --> | ||
- | Εισάγουμε το hyperlink (π.χ. http:// | ||
- | Πατάμε " | ||
- | Πατάμε " | ||
- | |||
- | ===== How to Set Up SSH Keys on Ubuntu 18.04 ===== | ||
- | |||
- | https:// | ||
- | |||
- | 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 ~/ | ||
- | |||
- | 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 " | ||
- | |||
- | The output will look something like this: | ||
- | |||
- | Enter file in which to save the key (/ | ||
- | |||
- | 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 | ||
- | / | ||
- | |||
- | 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' | ||
- | |||
- | Once the user is authenticated, | ||
- | |||
- | Number of key(s) added: 1 | ||
- | |||
- | Now try logging into the machine, with: " | ||
- | 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 ~/ | ||
- | |||
- | 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 / | ||
- | |||
- | sudo nano / | ||
- | |||
- | 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 < | ||
- | |||
- | |||
- | |||
- | Another alternate is: | ||
- | |||
- | log in to mysql using mysql -u < | ||
- | 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 / | ||
- | |||
- | 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:// | ||
- | |||
- | 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, | ||
- | https:// | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | To stop the vpn client from redirecting all internet traffic through vpn | ||
- | |||
- | docker-openvpn @ dipeira | ||
- | |||
- | https:// | ||
- | |||
- | - Follow the instructions @ Quick Start. | ||
- | |||
- | - Replace ovpn_genconfig line with | ||
- | docker run -v $OVPN_DATA:/ | ||
- | |||
- | - Make openvpn container persistent on reboots: | ||
- | docker run -v $OVPN_DATA:/ | ||
- | |||
- | |||
- | password for creating ovpn files for clients: ira.dipe | ||
- | |||
- | ===== WebServer-Backup.sh ===== | ||
- | |||
- | #!/bin/bash | ||
- | BACKUPDIR=/ | ||
- | ### Save the Virtual Machine state ### | ||
- | echo " | ||
- | VBoxManage controlvm WebServer savestate && echo " | ||
- | sleep 3 | ||
- | | ||
- | ### Create the Virtual Appliance with timestamp ### | ||
- | echo " | ||
- | VBoxManage export WebServer -o " | ||
- | sleep 3 | ||
- | | ||
- | ### Erasing ova files older than 8 days ### | ||
- | echo " | ||
- | find " | ||
- | sleep 3 | ||
- | | ||
- | ### Start the Virtual Machine ### | ||
- | echo " | ||
- | VBoxHeadless --startvm WebServer && echo " | ||
- | | ||
- | ### Use crontab - e to create a cronjob to execute this script every Monday and Thursday at 02:00### | ||
- | ### 0 2 * * 1,4 /bin/bash / |
start.1576149365.txt.gz · Last modified: 2019/12/12 13:16 by kotsimp