Example syntax for Secure Copy (scp)

What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Examples

Copy the file “foobar.txt” from a remote host to the local host

$ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file “foobar.txt” from the local host to a remote host

$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory “foo” from the local host to a remote host’s directory “bar”

$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Copy the file “foobar.txt” from remote host “rh1.edu” to remote host “rh2.edu”

$ scp your_username@rh1.edu:/some/remote/directory/foobar.txt \
your_username@rh2.edu:/some/remote/directory/

Copying the files “foo.txt” and “bar.txt” from the local host to your home directory on the remote host

$ scp foo.txt bar.txt your_username@remotehost.edu:~

Copy the file “foobar.txt” from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy multiple files from the remote host to your current directory on the local host

$ scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
$ scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .

scp Performance

By default scp uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.

$ scp -c blowfish some_file your_username@remotehost.edu:~

It is often suggested that the -C option for compression should also be used to increase speed. The effect of compression, however, will only significantly increase speed if your connection is very slow. Otherwise it may just be adding extra burden to the CPU. An example of using blowfish and compression:

$ scp -c blowfish -C local_file your_username@remotehost.edu:~

Contributions

Thanks Stewart Macleod for port example.

Ref : http://www.hypexr.org/linux_scp_help.php

How to Use SSL Certificate in LEMP Digital Droplet

(1) We need to create two Certificate to give to SSL Certificate Vendor
———————————-
examplesite.csr
examplesite.key
———————————-

=================================
How do I generate a CSR Code
=================================

———————————————————

OS – Ubuntu 14.04
Digital Ocean Droplet with LEMP
———————————————————

cd /etc/ssl
mkdir /etc/ssl/websitessl
openssl req -new -newkey rsa:2048 -nodes -keyout domainname.key -out domainname.csr

rsa:2048
“`means you create a 2048bits csr. I recommend for more security to use “`rsa:4069“`
You also need to change “`domainname.key“`and “`domainname.csr“` into your own domain name
so you can verify the CSR file. After you filled in all the legit information ,
you can open the new file using a client for example WinSCP, copy it, and use it for your SSL.


 

(2) And then, we have to buy/generate our SSL certificate at SSL Vendor Site and we will get / SSL vendor will generate the certificate files .
———————————–
samplesite.PEM
samplesite.ICA
samplesite.PKCS7
———————————–

We have to copy generated .PEM files from SSL Certifiate Provider to our host ( Digital Ocean LEMP )
http://www.examplesite.com.PEM.
And then, we have to edit the virtual host setting file at
/etc/nginx/site-available/samplesite

===================================================
Using SSL Certificate at Nginx Virtual Host Setting
===================================================
you have to create tow server blocks for both HTTP and HTTPS request.
And then, redirect to every request to HTTPS.

server {
listen 80;
server_name examplesite.com http://www.examplesite.com;
return 301 https://www.japanjobfair.com.mm$request_uri;
}

server {

listen 443 ssl;

#for SSL certificate Usage
listen 443 ssl;

root /var/www/examplesite/public;
index index.php index.html index.htm;

server_name examplesite.com http://www.examplesite.com\;

#for SSL certificate Usage
#ssl_certificate /path/to/your/domain.com.pem;
#ssl_certificate_key /path/to/your.key;
ssl_certificate /etc/ssl/websitessl/www.examplesite.com.PEM;
ssl_certificate_key /etc/ssl/websitessl/examplesite.key;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}

client_max_body_size 10M;
}

 

—————————————————————————————

Increase the Max Upload File Size at Nginx in Ubuntu 14.04

================================
Adding client_max_body_size” at Virtual Host of Nginx
================================
under /etc/nginx/site-available/sample_site_setting
———————————————————————-
server {
listen 8082;
listen [::]:8082;

root /var/www/registrations/public;
index index.php index.html index.htm;

server_name 128.199.226.122;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

client_max_body_size 10M;
}

================================
Increase the Max Upload File Size at PHP configuration
================================
/etc/php5/cli/php.ini
———————————————————————
from
post_max_size = 8M
upload_max_filesize = 2M
to
post_max_size = 10M
upload_max_filesize = 10M
———————————————————————–

Creating Wifi Hotspot at Window OS

How to tell if your PC supports Hotspot 2.0

Hotspot 2.0 is relatively new, and it’s available on Windows 10 devices with compatible hardware.

You can quickly check to see if your device supports Hotspot 2.0, using the following steps:

  1. Open Start.
  2. Search for Command Prompt and click the result.
  3. Type the following command and press Enter:

    netsh wlan show wirelesscapabilities

If the command output shows that your PC supports ANQP Service Information Discovery, you can connect to Hotspot 2.0 networks.

=====================================================

Set Up Wi-Fi Hotspot Using the Command Prompt at Windows 10

This method does not require you to download any third-party application. You can easily set up a Wi-Fi hostspot using the built-in tools in Windows OS.

Step 1 – You need to open the command prompt with administrator privileges.

Step 2 – Now we will create the hotspot. Simply enter the following command and press the Enter key:

Now we will create the hotspot. Simply enter the following command and press the Enter key:

netsh wlan set hostednetwork mode=allow ssid=YourHotspotName key=YourPassword

The SSID is the name of the Wifi connection and can be changed to anything you want. The KEY is the password and can be changed, also but bear in mind that it has to be at least eight characters.

Step 3 – You need to start the following command to start the WiFi hotspot:

netsh wlan start hostednetwork

Your WiFi hotspot should be activated and usable. You can check its status in the network and sharing center of your control panel.

 

You can now connect your devices to the hotspot and use the same WiFi connection without using third-party tools.

You can turn off the hotspot when not in use with the following command:

netsh wlan stop hostednetwork

 

=====================================================

Installation and Configuration Guide for Orangescrum Community Edition ( Ubuntu 14.04 LAMP )

Ref : https://hostpresto.com/community/tutorials/communityarticleshow-to-setup-and-install-orangescrum-on-ubuntu-14-04/

Requirements

  • A Server running Ubuntu 14.04
  • A Static IP Address for your server

Install Mysql

By default the mysql package is available in the Ubuntu 14.04 repository.

So, you can easily install mysql using the following command:

sudo apt-get install mysql-server

After this, start mysql service and enable mysql to start on boot.

sudo /etc/init.d/mysql start sudo update-rc.d mysql defaults

Install Php and Apache

After installing mysql, you will need to install PHP and Apache.

sudo apt-get install libapache2-mod-php5 php5 php5-cli php5-common php5-gd php5-mcrypt php5-mysql apache2

After this, start Apache service and enable Apache to start on boot.

sudo /etc/init.d/apache2 start sudo update-rc.d apache2 defaults

Download Orangescrum and Upload it to Apache Web root

You can download Orangescrum open source version from url https://github.com/Orangescrum/orangescrum.

sudo wget https://github.com/Orangescrum/orangescrum/archive/master.zip

After downloading Orangescrum you will need to unzip master.zip.

sudo unzip master.zip

After this, You will find the orangescrum-master directory.

Now, move this directory with name orangescrumPM to your Apache web root directory.

sudo mv orangescrum-master /var/www/html/orangescrumPM

Give proper permissions to the orangescrumPM directory.

sudo chown -R www-data:www-data /var/www/html/orangescrumPM sudo chmod -R 777 /var/www/html/orangescrumPM

Configure Mysql

In order to log into MySQL to secure it, you’ll need the current password for the root user. If you’ve just installed MySQL, and you haven’t set the root password yet, the password will be blank.

sudo mysql_secure_installation

Answer all the questions shown as below:

Enter current password for root (enter for none): **currentrootpasswd**
Set root password? [Y/n]: **Press Enter**
New password: **rootsqlpasswd**
Re-enter new password: **rootsqlpasswd**
Remove anonymous users? [Y/n]: **Press Enter**
Disallow root login remotely? [Y/n]: **Press Enter**
Remove test database and access to it? [Y/n] : **Press Enter**
Reload privilege tables now? [Y/n] : **Press Enter**

All done! If you’ve completed all of the above steps, your MySQL installation should now be secure. Now, You need login to mysql, create database and user for Orangescrum.

sudo mysql -u root -p

Create the database with the name Orangescrum:

mysql> create database orangescrum;

Create the user with the name orangescrum:

mysql> create user orangescrum;

Grant all privileges while assigning the password, chose a secure password and replace my-secret-password with your own:

mysql> grant all on orangescrum.* to 'orangescrum'@'localhost' identified by 'my-secret-password';

Exit from the mysql shell:

mysql> exit

Now, You will need to import the database from database.sql file located in /var/www/html/orangescrumPM directory.

First, change into the orangescrum directory:

sudo cd /var/www/html/orangescrumPM/

Now import the sql file:

sudo mysql -u orangescrum -porangescrum < database.sql

Next, by default STRICT mode is On in Mysql. So you need to disable it.

You can do this by editing my.cnf file:

sudo nano /etc/mysql/my.cnf

Add the following line at the end of file:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Save and close the file, restart mysql to reflect changes.

sudo /etc/init.d/mysql restart

##Configure PHP

Now, You wiil need to change the ‘post_max_size’ and upload_max_filesize to 200M in php.ini.

You can do this by editing the php.ini file:

sudo nano /etc/php5/cli/php.ini

Change the post_max_size and upload_max_size as shown below:

post_max_size=200M
...
upload_max_filesize=200M

Save and close the file.

Configure Apache

The next step is to add orangescrumPM in the Apache default configuration file.

You can do this by editing apache2.conf file:

sudo nano /etc/apache2/apache2.conf

Add the following content:

``` language-bash

Options Indexes ExecCGI MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all


When you are finished, it is recommended to check the configuration for syntax errors.

`sudo apachectl configtest`

You should see following output if Apache configuration syntax is correct:

Syntax OK


After the syntax check is done you need to enable Apache headers and rewrite module.

You can do this by running:

`sudo a2enmod rewrite` `sudo a2enmod headers`

Now, restart Apache to reflect the changes:

`sudo /etc/init.d/apache2 restart`

## Configure Orangescrum

Now you need to update the database connection details in `database.php` file.

You can do this by editing `database.php` file.

`sudo nano /var/www/html/orangescrumPM/app/Config/database.php`

Change the following lines, not forgetting to substitute in your password instead of 'my-secret-password':

    class DATABASE_CONFIG {

public $default = array( 'datasource' => 'Database/Mysql', 'persistent' => false,'host' => 'localhost', 'login' => 'orangescrum', 'password' => 'my-secret-password', 'database' => 'orangescrum', 'prefix' => '', 'encoding' => 'utf8', );}


Save and close the file when you are finished.

Next, you will need to provide an SMTP service for Orangescrum to send email from. In this example we use a Gmail account, but you can use any SMTP service such as Sendgrid or Mandrill.

Edit the Orangescrum `constants.php` file:

`sudo nano /var/www/html/orangescrumPM/app/Config/constants.php`

Change the following line:

    //Gmail SMTP
    define("SMTP_HOST", "ssl://smtp.gmail.com");
    define("SMTP_PORT", "465");
    define("SMTP_UNAME", "user@gmail.com");
    define("SMTP_PWORD", "**********");define('FROM_EMAIL_NOTIFY', 'user@gmail.com'); //(REQUIRED)
    define('SUPPORT_EMAIL', 'user@gmail.com'); //(REQUIRED) From Email
    define("DEV_EMAIL", 'user@gmail.com'); // Developer Email ID to report the application error

define('SUB_FOLDER', '/');

“`

FROM_EMAIL_NOTIFY : All the tasks created/updated notification emails will be sent from this email address.

SUPPORT_EMAIL : All other emails and support related emails will be sent from this email address.

Save and close the file, when you are finished.

##Testing Orangescrum

From a remote machine, open your Firefox browser and type url http://your-server-ip-address

You will be asked to provide your Company Name, Email address and a Password to login and start using Orangescrum.

After this, you can see the orangescrum welcome page.