Sunday, December 30, 2018

Apache 2.4 /PHP7.3 /PHP-FPM /freeBSD 12 (part 1)

Install Apache 2.4:
# cd /usr/ports/www/apache24/ && make install clean BATCH=yes
Just append BATCH=yes at the end of the command and they will go straight away as they are without asking anymore.

httpd.conf:
# cp /usr/local/etc/apache24/httpd.conf /usr/local/etc/apache24/httpd.conf.original
# ee /usr/local/etc/apache24/httpd.conf

Virtual host configuration:
# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
    ServerName 13.211.209.48
    ServerAlias example
    DocumentRoot "/usr/local/www/apache24/life110volts.com"
    DirectoryIndex index.php index.html

    <Directory /usr/local/www/apache24/life110volts.com>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    <FilesMatch \.php$>
         SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    ErrorLog /var/log/life110volts.com-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/life110volts.com-access.log combined

</VirtualHost>

VirtualHost Examples: https://httpd.apache.org/docs/2.4/vhosts/examples.html


Website:
# mkdir /usr/local/www/apache24/life110volts.com
# ls -l /usr/local/www/apache24/life110volts.com
# chown -R www:www /usr/local/www/apache24/life110volts.com
# chown -R 755 /usr/local/www/apache24/life110volts.com
# ee /usr/local/www/apache24/life110volts.com/index.html
# ee /usr/local/www/apache24/life110volts.com/index.php
# ee /usr/local/www/apache24/life110volts.com/info.php

Start/Stop:
# sysrc apache24_enable=yes
# apachectl configtest
# service apache24 onestart
# service apache24 restart && service nginx reload

Curl the web page on Localhost.
# cd /usr/ports/ftp/curl && make install clean
# curl -i 127.0.0.1:8080/info.php
# curl -i 127.0.0.1:8080

Install PHP 7.3
To get a list of all available PHP version packages provided by FreeBSD Ports repositories
# ls /usr/ports/lang/ | grep php
# whereis mod_php73
# cd /usr/ports/lang/php73 && make install clean
(choose the php-FPM box)
(# make config)
# rehash
# php -v
# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

Install PHP-FPM
FastCGI Process Manager - alternative FastCGI implementation
In addition to Apache and PHP-FPM, we will also install the PHP FastCGI Apache module, libapache2-mod-fastcgi, to support FastCGI web applications. In order to get the ability of handling the FastCGI protocol, mod_proxy and mod_proxy_fcgi have to be present in the server.
#LoadModule proxy_module libexec/apache24/mod_proxy.so
#LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so

Normally PHP-FPM configuration files are located on /usr/local/etc/php-fpm.conf file and /usr/local/etc/php-fpm.d path. This is normally excellent start and all pool configs goes to /usr/local/etc/php-fpm.d directory. You need to add following include line on your php-fpm.conf file:
include=/etc/php-fpm.d/*.conf

Configure PHP-FPM
# ee /usr/local/etc/php-fpm.d/www.conf
listen = 127.0.0.1:9000 //
listen = /var/run/php-fpm.sock
listen = /var/run/php72-fpm.sock //
listen.owner = www
listen.group = www
listen.mode = 0660

# sysrc php_fpm_enable=YES

Start/Stop:
# service php-fpm stop
# service php-fpm start
# service php-fpm restart
# service php-fpm status

Nginx:Installing 
# cd /usr/ports/www/nginx && make config-recursive
- Accept the defaults.
# make install clean

Edit Nginx.conf
# nano /usr/local/etc/nginx/nginx.conf

# sysrc nginx_enable="YES"
# sudo nginx -t
# sudo service nginx reload

Location of importants files:
Nginx:
# ee /usr/local/etc/nginx/nginx.conf
Document Dir:
# ls /usr/local/www/
Modules dir:
Logs:
/var/log/nginx/example.com.access.log;

Apache:
# ee /usr/local/etc/apache24/httpd.conf
Web dir or DocumentRoot/ Directory:
# ls -l /usr/local/www/apache24/data
Modules.d directory:
# ee /usr/local/etc/apache24/modules.d/030_php-fpm.conf
Logs:
tail -f /var/log/httpd-access.log
tail -f /var/log/httpd-error.log
Includes:
# ee /usr/local/etc/apache24/Includes/php.conf

PHP:
# ee /usr/local/etc/php-fpm.d/www.conf
# ee /usr/local/etc/php-fpm.conf
# ee /usr/local/etc/php.ini

freeBSD:
# ee /etc/rc.conf

Courtesy:
1. How to install NGINX in CentOS 7 or FreeBSD and configure it to act as a Reverse Caching Proxy for Apache

Saturday, December 29, 2018

IPFW stateful firewall written for FreeBSD

IPFW is a stateful firewall written for FreeBSD.

# ee /etc/rc.conf
/etc/rc.conf
. . .
nginx_enable="YES"
firewall_enable="YES"
firewall_type="workstation"
firewall_myservices="22/tcp 80/tcp"
firewall_allowservices="any"
For the first time to run the server (in csh or tcsh shells, freeBSD)
# nohup service ipfw start >&/tmp/ipfw.log

Stop, start and restart the ipfw service.
# sudo service ipfw stop
# sudo service ipfw start
# sudo service ipfw restart

Friday, December 28, 2018

freeBSD Pkg operations

Link: Using pkg for Binary Package Management

Package Information with Pkg:
# pkg info package_name

Search for packages name:
# pkg search package_name
# pkg search -o php
Detailed package information:
# pkg search -f package_name
For a specific version of PHP:
# pkg search php5 | less
# pkg search php7
# pkg search nginx

Search the descriptions:
# pkg search -D pattern
# pkg search -D java
# pkg help search

Package install with Pkg:
# pkg install package_name
# pkg install package1 package2 ...
# pkg install nginx

If you are using the default shell, tcsh, or csh, you should rebuild the list of binaries in your PATH with this command:
# rehash

Run Services:
Runs as a service:
# ee /etc/rc.conf
# sysrc nginx_enable=yes
# service nginx start

Upgrade Installed Packages with Pkg:
# pkg upgrade

Delete Packages with Pkg:
# pkg delete package_name
# pkg delete package1 package2 ...
# pkg delete nginx

Remove Unused Dependencies
# pkg autoremove


Furthue reading: Install with ports.
OS: freeBSD 12

Thursday, December 27, 2018

Pointing a domain to your server public IP

1. Ngnix ready

2. Edit "A" record of your domain and point it to your public IP address.
Host : @
Points to : 52.65.138.1
TTL : 1 Hour

3. Nameservers remains defult.

4. Ngnix server block point your public IP:
    server {
        listen       8081;
        server_name  52.65.138.1;

5. Go! mydomail.com:8081 => Test ok!

Next step:

SRV (godaddy DNS):

Type : SRV
Service : _http
Protocol: _tcp
Name : e1.life110volts.com
Priority: 0
Weight : 0
Target : @
Prot : 8081
TTL : 1 Hour

Nginx on freeBSD: 3. Install free TLS/SSL certificates

(let assume you have a webserver with a public ip, and your DNS A record is pointing to your public IP)

Install Certbot:
# portsnap fetch
# portsnap extract

Install Let's Encrypt client:
# cd /usr/ports/security/py-certbot
# sudo make install clean

Install NGINX plugin for Certbot:
# cd /usr/ports/security/py-certbot-nginx
# sudo make install clean

Setting Up a Firewall and Allowing HTTPS Access:
Inside file, /etc/rc.conf
firewall_myservices="22/tcp 80/tcp 443/tcp"
Port 433/tpc must be open
IPFW is a stateful firewall written for FreeBSD.

Obtaining an SSL Certificate:
# sudo certbot --nginx -d life110volts.com -d www.life110volts.com
Give your email, domain ownership challange.


IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /usr/local/etc/letsencrypt/live/life110volts.com/fullchain.pem
   Your key file has been saved at:
   /usr/local/etc/letsencrypt/live/life110volts.com/privkey.pem
   Your cert will expire on 2019-03-28. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /usr/local/etc/letsencrypt. You should
   make a secure backup of this folder now. This configuration
   directory will also contain certificates and private keys obtained
   by Certbot so making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Check your website:
SSL Server Test


Part: 2, 
Renew certificate:
You need to automate certificate renewal by setting up a cron task. It’s important to test that you’re able to renew certificates correctly.

# sudo certbot renew --dry-run
If you see no errors, you’re all set to create a new crontab:

# sudo crontab -e 
This will open a new crontab file, paste bellow line in that file, it will auto renew your certificate if it close to date.
0 0,12 * * * /usr/local/bin/certbot renew


Port block!! Checkpoint in firewalls

Nginx
# ee /usr/local/etc/nginx/nginx.conf

IPFW
# ee /etc/rc.conf

AWS - Security Group
Enable ports

Reload:
# service nginx reload
# service ipfw restart

Related article: Install Nginx on freeBSD

Nginx on freeBSD: 2. Setting Up a server Block

cont... (Install Nginx on freeBSD)

Nginx on FreeBSD 11.2 has one server block enabled by default that is configured to serve documents out of a directory at /usr/local/www/nginx. While this works well for a single site, it can become unwieldy if you are hosting multiple sites. Instead of modifying /usr/local/www/nginx, let's create a directory structure within /usr/local/www for our example.com site.

#sudo mkdir -p /usr/local/www/example.com/

Assign ownership of the directory to the www user:
#sudo chown -R www:www /usr/local/www/example.com

The permissions of your web root should be correct if you haven't modified your umask value, but you can make sure by typing:
# sudo chmod -R 755 /usr/local/www/example.com

# sudo ee /usr/local/www/example.com/index.html
<h1>Web example 1</h1>

Change the configuration
To find the cpu cores:
# sysctl hw.ncpu
# sudo ee /usr/local/etc/nginx/nginx.conf
(To load from the system backup
#sudo cp /usr/local/etc/nginx/nginx.conf-dist /usr/local/etc/nginx/nginx.conf)

/usr/local/letc/nginx/nginx.conf
user  www;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        access_log /var/log/nginx/example.com.access.log;
        error_log /var/log/nginx/example.com.error.log;
        listen       80;
        server_name  example.com www.example.com;

        location / {
            root   /usr/local/www/example.com;
            index  index.html index.htm;
        }

    }

}

# sudo nginx -t
# sudo service nginx reload

For port check: Port firewall/block checking points

Funny mistakes:
1. You need to login from outside network to login with the public IP!
2. Make sure your port is open.

Wednesday, December 26, 2018

Nginx on FreeBSD: 1 - Installation /Uninstall

Installation:
# pkg install nginx
If you check the which shell
# echo $SHELL

Enable Ngnix service
rc is a FreeBSD utility that controls the system's automatic boot processes.Scripts for every service available on the system are located in the /usr/local/etc/rc.d directory. These define the parameters that are used to enable each service using the rcvar variable
# grep rcvar /usr/local/etc/rc.d/*


After has been installed, this command will output a listing similar to this:
Output
/usr/local/etc/rc.d/cloudconfig:rcvar="cloudinit_enable" /usr/local/etc/rc.d/cloudinitlocal:rcvar="cloudinit_enable" /usr/local/etc/rc.d/nginx:rcvar=nginx_enable /usr/local/etc/rc.d/rsyncd:rcvar=rsyncd_enable
The parameter that you need to set for the nginx service is highlighted here in this output. The name of the script itself — the last component of the path before the colon — is also helpful to know, as that's the name that FreeBSD uses to refer to the service.
To enable the nginx service you must add its rcvar to the rc.conf file, which holds the global system configuration information referenced by the startup scripts. Use your preferred editor to open the /etc/rc.conf file with sudo privileges. Here, we'll use 
# sudo ee /etc/rc.conf
/etc/rc.conf
. . .
sshd_enable="YES"
nginx_enable="YES"

IPFW is a stateful firewall written for FreeBSD.

Directly below the nginx_enable parameter you just added, add the following highlighted lines:
/etc/rc.conf
. . .
nginx_enable="YES"
firewall_enable="YES"
firewall_type="workstation"
firewall_myservices="22/tcp 80/tcp"
firewall_allowservices="any"
For the first time to run the server (in csh or tcsh shells, freeBSD)
# nohup service ipfw start >&/tmp/ipfw.log

Stop, start and restart the ipfw service.
# sudo service ipfw stop
# sudo service ipfw start
# sudo service ipfw restart

Start the Nginx service:
# service nginx start

Stop Ngnix:
# service nginx stop
# rm -f -R /usr/local/nginx && rm -f /usr/local/sbin/nginx
# rm -rf /var/www
# sysrc nginx_enable=no
http://192.168.10.114/
OR, to see the public ip address: 
# curl -4 icanhazip.com

To setting Up a server Block using a domain name.


Uninstall Nginx:
From ports:
# service nginx stop
# cd /usr/ports/www/nginx && make deinstall
Check the liestening ports
# sockstat -4 -l




FreeBSD: Starting your day! Essential commands

Log in to the server with the private key:
# ssh -i ~/.ssh/freeBSD junayed@192.168.10.114 -p 22

$ ssh -i freeBSD junayed@192.168.10.114

List services:
# service -e

# nginx -v
# sockstat -4 -l
uname -vm

Sunday, December 23, 2018

JIRA on FreeBSD

1. Download Jira .tar.gz version from Atlassian’s website.

2. sftp the file to your server.
# sftp -i "aws-domo.pem" ec2-user@exxx.amazonaws.com
# sftp> put atlassian-jira-software-7.13.0-x64.bin
# sftp> ! (to exit from the sftp)
Bingoo!

3. Install tomcat-native
# pkg install openjdk8 tomcat-native
OR
# pkg install openjdk
# java -version

4. create a user for JIRA
# adduser
# adduser

Username: jira
Full name: JIRA psuedo-user
Uid (Leave empty for default): 71
Login group [jira]: 
Login group is jira. Invite jira into other groups? []: 
Login class [default]: 
Shell (sh csh tcsh zsh rzsh git-shell nologin) [sh]: 
Home directory [/home/jira]: /usr/local/jira
Home directory permissions (Leave empty for default): 
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: no
Username   : jira
Password   : <disabled>
Full Name  : JIRA psuedo-user
Uid        : 71
Class      : 
Groups     : jira 
Home       : /usr/local/jira
Home Mode  : 
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (jira) to the user database.

5. Install MySQL server (jira need this)
GRANT ALL PRIVILEGES ON *.* TO 'jira'@'localhost' IDENTIFIED BY 's@ydrfD34FEds';
exit
# mysql -u jira -p
CREATE DATABASE jira;

6. JIRA Setup
Extract the .tar.gz we downloaded from Atlassian
root@freebsd:/usr/home/ec2-user # tar xzvf atlassian-jira-software-7.13.0.tar.gz
# mv atlassian-jira-software-7.13.0-standalone /usr/local/share/jira
# mkdir /usr/local/jira

# cd /usr/local/share/jira 
# chown jira:jira logs temp work

#!/bin/sh

#
# PROVIDE: jira
# REQUIRE: DAEMON 
# KEYWORD: shutdown

. /etc/rc.subr

load_rc_config jira

JAVA_HOME="/usr/local/openjdk8"
JRE_HOME="/usr/local/openjdk8/jre"
JIRA_INSTALL="/usr/local/share/jira"
JIRA_HOME="/usr/local/jira"

jira_enable=${jira_enable:-"NO"}
jira_user=${jira_user:-"jira"}

name=jira
rcvar=jira_enable

procname="java"
pidfile="/var/run/jira.pid"

start_cmd="jira_start"
stop_cmd="jira_stop"

jira_start()
{
 su -l ${jira_user} -c "export JAVA_HOME=${JAVA_HOME};export JRE_HOME=${JRE_HOME};export JIRA_HOME=${JIRA_HOME};${JIRA_INSTALL}/bin/catalina.sh start || err 1 'Error triggering JIRA startup'"
}

jira_stop()
{
 su -l ${jira_user} -c "export JAVA_HOME=${JAVA_HOME};export JRE_HOME=${JRE_HOME};export JIRA_HOME=${JIRA_HOME};${JIRA_INSTALL}/bin/catalina.sh stop 10 -force || err 1 'Error triggering JIRA shutdown'"
}

run_rc_command "$1"
Change your directories as required.
Save that to /usr/local/etc/rc.d/jira and we’ll need to make it executable with `

# chmod u-w,ugo+x /usr/local/etc/rc.d/jira
# sysrc jira_enable="YES"
# /usr/local/etc/rc.d/jira start or service jira start

Display IPv4 related open ports
# sockstat -4 -l
Make a port forward in the router, and point your browser at http://xxx:8080

Congratulation!

Friday, December 21, 2018

MySQL server 5.7 installation of freeBSD 12

(It is recommended that to install MySQL before the installation of PHP_extension to avoid old extension installation.)

Method #1. Install using port: (not working!)
# cd /usr/ports/databases/mysql80-server && make install clean BATCH=yes

(By default, we will compile the software from source, it is not built in static. According to MySQL documentation, building the binary using static will result a 13% improvement comparing to building the binary using dynamic. Here is an example how to build MySQL with static option enabled)

# make BUILD_OPTIMIZED=yes BUILD_STATIC=yes
# make install clean
(It takes ...time hr)

/etc/rc.conf
mysql_enable="YES"
# sysrc apache24_enable=yes

Method #2, Installusing pkg:
# pkg update
# pkg upgrade
# pkg install mysql57-server mysql57-client
# sysrc mysql_enable="yes"
# service mysql-server start


MySQL secure installation:
(Note the password)
# cat $HOME/.mysql_secret
yFH&pek0yw3

# mysql_secure_installation
Answer them all with ...y
# mysql -u root -p 
password: yFH&pek0yw3
root@localhost [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'yFH&pek0yw3';
root@localhost [(none)]> show databases;

Create a user / database in MySQL:
GRANT ALL PRIVILEGES ON *.* TO 'jira'@'localhost' IDENTIFIED BY 's@ydrfD34FEds';
exit
# mysql -u jira -p
CREATE DATABASE jira;

Check the latest version of the MySQL:
# mysqladmin -u root -p version

Start/Stop:
# sudo /usr/local/etc/rc.d/mysql-server start
# service mysql-server start
# sudo /usr/local/etc/rc.d/mysql-server start

Link:
Install Portsnap

Ref:
1. How to Install MySQL Server with phpMyAdmin on FreeBSD 11
2. The easiest way to improve the performance of MySQL server on FreeBSD

Install Portsnap


Links: Installing Applications: Packages and Ports: Using the Ports Collection.

Install Portsnap:
Get the ports collection and extract it.
# portsnap fetch extract
# portsnap fetch update

# whereis apache24

Example:
Install the Nano editor, go to ports directory;
# cd /usr/ports/editors/nano && make install clean

Removing Installed Ports:
# cd /usr/ports/editors/nano
make deinstall

Check the listening ports:
# sockstat -4 -l

Upgrading Ports Using Portmaster:
ports-mgmt/portmaster is a very small utility for upgrading installed ports. It is designed to use the tools installed with the FreeBSD base system without depending on other ports or databases. To install this utility as a port:
# cd /usr/ports/ports-mgmt/portmaster
# make install clean

To list these categories and search for updates:
# portmaster -L

This command is used to upgrade all outdated ports
# portmaster -a
If errors are encountered during the upgrade process, add -f to upgrade and rebuild all ports:
# portmaster -af

Portmaster can also be used to install new ports on the system, upgrading all dependencies before building and installing the new port. To use this function, specify the location of the port in the Ports Collection:
# portmaster shells/bash

Upgrading Ports Using Portupgrade:
# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

Change the root password - FreeBSD


Login in EC2 with root user - freeBSD

1. Please type # passwd in super user (root)mood.

Thursday, December 20, 2018

Set up an SSH server with the key! freeBSD

For basic mechanism, you may consider the public key as the lock and the private key as its key.

"A word of caution – the root account should NEVER have SSH access. If somehow someone breaks into the SSH server they would have administrative access. Administrative access can always be obtained by using su and entering the root password – which should be different from the user’s password!"

FreeBSD has an SSH server and client out of the box, it just needs to be enabled.
You need ssh public/private key first, so let's make it.

Initial login with no key pair (default):
# ssh junayed@192.168.10.114 (my ssh server LAN IP)

links: https://man.openbsd.org/ssh-keygen.1,
Generating a new SSH key and adding it to the ssh-agent
Configuring sshd

Create a key pair from your desktop bash /OR inside in server directly(not from the root account):
# ssh-keygen -t rsa -b 4096 -C "y@ex.com"
# ssh-keygen -t ecdsa -b 4096 -C "y@ex.com" -f ~/.ssh/freeBSD -N abc123

here,
[-C comment]
[-t dsa | ecdsa | ed25519 | rsa]
[-b bits] 4096
[-f output_keyfile]
[-N new_passphrase]

Sample Server credentials details,
port: 22
Server name: mg1149
-f freeBSD -N xyz987

AUTHORIZED KEY:
An authorized key in SSH is a public key used for granting login access to users. The authentication mechanism is called public key authentication.
Authorized keys are configured separately for each user - usually in the .ssh/authorized_keys file in the user's home directory. However, the location of the keys can be configured in SSH server configuration files and is often changed to a root-owned location in more secure environments.

Typically provisioning an authorized key involves generating a key pair, installing the public key as an authorized key, and using the private key as an identity key.

The first command will add your desktop’s public key to the server’s list of allowed desktop computers to connect (authorized keys)

Option 1: Operation inside the server;
# cat id_rsa.pub >> ~/.ssh/authorized_keys
# rm id_rsa.pub
# cat ~/.ssh/id_rsa
Copy the content and paste it into a blank file, name it id_rsa. 
From your desktop, make login with this private keys.
$ ssh -i ~/.ssh/freeBSD2 junayed@192.168.10.114 -p 22

Option 2: Operation from the desktop;
You need to use the SSH-COPY-ID
Create lock/key from your desktop, then copy the Lock/Public-key to the server using
# ssh-copy-id -i ~/.ssh/mykey user@host
# ssh-copy-id -i ~/.ssh/freeBSD.pub junayed@192.168.10.114 /103.10....
(Login to the machine)
(Authorize and delete public key)
# cat id_rsa.pub >> ~/.ssh/authorized_keys
# rm id_rsa.pub

Adding your SSH key to the ssh-agent:
# eval $(ssh-agent -s)
# ssh-add ~/.ssh/freeBSD

Log in to the server with the private key:
# ssh -i ~/.ssh/freeBSD junayed@192.168.10.114 -p 22

Securing your SSH Server

Lastly:
If you don’t plan to use SFTP/SCP to transfer files you should disable it. Do this by commenting out the line that starts with # Subsystem sftp.

Don't forgot: Setting up your router port forwarding to :22

Funny mistake: You need to login from outside network to login with the public IP!


SFTP freeBSD

SFTP port is open by default by AWS. So just log in, and ftp.
# sftp -i "aws-domo.pem" ubuntu@ec2-13-55-197-77.ap-southeast-2.compute.amazonaws.com

Check Present Working Directory from a remote server.
sftp> lpwd
Remote working directory: /tecmint/

Local working directory: 
sftp> pwd

Upload a File
sftp> put local.profile

However, if you don’t plan to use SFTP/SCP to transfer files you should disable it. Do this by commenting out the line that starts with # Subsystem sftp at the bottom of the file.
# ee /etc/ssh/sshd_config

Don't forget: Setting up your router port forwarding to 22
Funny mistake: You need to log in from the outside network to log in with the public IP!


Wednesday, December 19, 2018

FreeBSD 10.x download and Installation

Installation Settings:

Hostname: mg1149
HDD capacity: 224GB

File system and partitioning:
/ = 221GB = freebsd-ufs
/home = 1024MB = freebsd-ufs
[empty] = 2048MB = freebsd-swap  [half of size of your RAM for the swap]


user root / pass abc123
user junayed / pass abc123

Link: FreeBSD Unix: Downloading and Installing 10.x
Go from install disk to Firefox in FreeBSD!: Install FreeBSD (with GUI!)

Friday, December 14, 2018

Login in EC2 with root user - freeBSD

1: Use the SSH to connect to the EC2 FreeBSD instance with the username "ec2-user".

# ssh -i "aws-domo.pem" ec2-user@x.amazonaws.com

It will not require any pass from you.

2: run the command "su" to gain superuser privilege, it will make you the "root" user.

Enjoy!