Sabtu, 26 November 2016

DNS Server Debian 7.2

What's DNS ?

The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of computer services and devices worldwide. (en.wikipedia.org)

Installation.

in terminal as root, type :

apt-get install bind9


next we will create two databases, namely the reverse and forward.
  1. we entered into a bind directory,    
 type: cd /etc/bind
then type : ls


we will look at some of the existing database files. like this :


bind.keys  db.empty    named.conf.default-zones  zones.rfc1918
db.0       db.local    named.conf.local
db.127       db.root     named.conf.options
db.255       named.conf  rndc.key


Create a database by copying and editing an existing database.
Create a reverse database, type: cp db.127 [db.name].
cp db.127 db.myreverse

Create a forward database, type : cp db.local [db.name].
cp db.local db.myforward

then we see, whether the database has been created by typing ls.  
bind.keys  db.255    db.myforward  named.conf             named.conf.options
db.0       db.empty  db.myreverse  named.conf.default-zones  rndc.key
db.127       db.local  db.root       named.conf.local         zones.rfc1918

 

Now we see that the database has been successfully created (blue text).

then we will do the editing on db.myreverse and db.myforward database, as follows:  

Editing db.myreverse, type : nano db.myreverse

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     stemsa.net. root.stemsa.net. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@               IN      NS      stemsa.net.
100.168.192     IN      PTR     www.stemsa.net.
 

save and exit by press Ctrl+X

 Editing db.myreverse, type : nano db.myforward

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     stemsa.net. root.stemsa.net. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      stemsa.net.
@       IN      A       192.168.100.1
www     IN      A       192.168.100.1
 

 save and exit by press Ctrl+X

  

  1. s

Jumat, 14 November 2014

Changing SSH Port

Default port of SSH is 22, but for certain reasons such as safety then we can change that port.

 Open terminal as root, type :

nano /etc/ssh/sshd_config

look for the following line:


# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
…...................................

then we change the port 22 corresponding port we want.


# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 23
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
…...................................

or can we add multiple ports 

# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
Port 23
Port 1000
Port 1001
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
 ...........................

save and exit by pressing Ctrl+X.

Try port connection.

run putty.exe on the client PC

in the Ports tab, enter the port that we have a fox earlier.






 

Rabu, 12 November 2014

SSH Server

An SSH server is a software program which uses the secure shell protocol to accept connections from remote computers. SFTP/SCP file transfers and remote terminal connections are popular use cases for an SSH server. This article compares a selection of popular servers (en.wikipedia).

Installing SSH.
in the terminal as root type:
apt-get install ssh -y

Use PuTTY application.
PuTTY is a free implementation of Telnet and SSH for Windows and Unix platforms, along with an xterm terminal emulator.

In the computer/laptop Windows client, download and run "putty.exe"
Fill in Host Name (or IP address) with IP Address of eth1, and default Port is 22.

Clik Open.





Then in security alert click Yes.
Fill in login as: root
and password : [root password]


Now we connect with server.

 DONE.






Selasa, 11 November 2014

DHCP Configuration


What is Dynamic Host Configuration Protocol (DHCP)?

Dynamic Host Configuration Protocol (DHCP) is network protocol for automatically assigning TCP/IP information to client machines. Each DHCP client connects to the centrally-located DHCP server which returns that client's network configuration including IP address, gateway, and DNS servers.


Let's get started.

in terminal as root, type:
apt-get install isc-dhcp-server

Unable to locate package isc-dhcp-server

If the message appears, it indicates that the package is not available in DVD1 Debian 7.2.
what should we do to deal with this problem.
I suggest to replace the debian repository to local server Indonesia.



change the repository to a local server Indonesia.
 nano /etc/apt/sources.list

then on the bottom line, add the following list:

deb http://kambing.ui.ac.id/debian/ wheezy main non-free contrib
deb-src http://kambing.ui.ac.id/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free 
 


Then save and exit by pressing Ctrl + X on the keyboard

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
answer yes bay pressing y on keyboard.

Connect your PC to internet.

Then, on the terminal type:
apt-get update

after the update process is complete, then typing the command 

apt-get install isc-dhcp-server

system will start to download the package.

done.


after the package dhcp server is installed, the next step is to edit the following files:  /etc/dhcp/dhcpd.conf

look for the following line:

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
#  range 10.5.5.26 10.5.5.30;
#  option domain-name-servers ns1.internal.example.org;
#  option domain-name "internal.example.org";
#  option routers 10.5.5.1;
#  option broadcast-address 10.5.5.31;
#  default-lease-time 600;
#  max-lease-time 7200;
#}

 
 

edit like the following :
# A slightly different configuration for an internal subnet.
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.100 192.168.100.200;
option domain-name-servers 192.168.100.1, 192.168.60.254;
option domain-name "stemsanet.net";
option routers 192.168.100.1;
option broadcast-address 192.168.100.255;
default-lease-time 600;
max-lease-time 7200;

}

Then save and exit by pressing Ctrl + X on the keyboard
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
answer yes bay pressing y on keyboard.
done.

the next step is to edit the following files:  /etc/default/isc-dhcp-server
look for the following line:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""


edit like the following :
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"


Then save and exit by pressing Ctrl + X on the keyboard
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
answer yes bay pressing y on keyboard.

done.

Starting the DHCP server.
on the terminal type:

/etc/init.d/isc-dhcp-server start



In Client PC/Laptop, open Local Area Connection.

  DONE.

Senin, 10 November 2014

Debian 7.2 Desktop as Server (IP Address Cofiguration)

Yesterday we've been doing the installation Debian 7.2 Desktop as Server, now we are going to configure the IP address that is etherne 0 for an ethernet connection to the router and ethernet 1 for the local connection.

Open a terminal as root.


nano /etc/network/interfaces

edit the following files.


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

 


then add the following command line (blue line) :

 # This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.60.254
        netmask 255.255.255.0
        network 192.168.60.0
        broadcast 19.168.60.255
        gateway 192.168.60.1


auto eth1
iface eth1 inet static
        address 192.168.100.1
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255


Then save and exit by pressing Ctrl + X on the keyboard

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
answer yes bay pressing y on keyboard.



then restart the networking service, in order to apply the new configuration, use this command :

/etc/init.d/networking restart or service networking restart

to see the new configuration the following command: 

ifconfig




that's how the configuration of the IP Address.

--------------------------------------------------------------------------------------------------------------------------------------

some of the problems that sometimes occur when configuring the IP Address:
the system does not recognize ethernet well, usually occurs in ethernet 1 (not onboard), use the following command:

ifup [interface_number]

ifup eth1






done.



 

Jumat, 07 November 2014

Debian 7.2 Desktop as Server

In this tutorial we are going to install my Debian 7.2 Desktop x64 as a server.
PC specification used is AMD Phenom(tm) II X2 555 Processor, 2 Gb Of Ram, 500 Gb Hardisk, 2 NIC.

let's get started.
 
Turn on the PC, set the BIOS to boot from the DVD-Room, input Debian 7.2  to the DVD-Room and restart the PC.




































































DVD room automatically open, grab the DVD from the DVD-room.
Re-set the BIOS to boot from the hard drive.
Enjoy. 















Kamis, 06 November 2014

CHMOD Linux Command (numeric mode)

After we read about chmod octal mode, this time we will change right akases or chmod files / folders using a numeric mode. Actual numeric mode is almost similar to the calculation of the octal mode. Numeric mode refers to the following table:

 through the table we can determine what number should we fill in to change the access rights according to our wishes.
for example:
note the blue line below.

The distribution of access rights.

 drwxr-xr-x 2 root root   4096 Nov  5 20:48 cdebconf




 
The blue colored lines declare the permissions of a directory.
Now we will change the access rights on a calculation using numeric mode table above.
As in the calculation of octal mode, the access rights will now be divided into three groups, each group having 3 digit number that represents the permissions.

d          rwx          r-x          r-x     2 root root   4096 Nov  5 20:48 cdebconf
          group-1       group-2       group-3
                user           group           other

 Now we will change the directory access rights are entitled to full access to all its group. Note the calculations in the table above.

typing in a terminal
chmod 777 filename

chmod 777 cdebconf or
chmod 0777 cdebconf

then type :

ls -l
  
drwxrwxrwx 2 root root   4096 Nov  5 20:48 cdebconf
 



prior to the change permissions:
 drwxr-xr-x 2 root root   4096 Nov  5 20:48 cdebconf

after changes permissions :
drwxrwxrwx 2 root root   4096 Nov  5 20:48 cdebconf    
Related Posts Plugin for WordPress, Blogger...