Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Friday, July 31, 2015

Enabling debugging in OpenSSH client and server

Assumptions :
     1.) Linux Debian based configuration files are used. (OpenSSH_5.5p1 Debian-6+squeeze5)

SSH Server :

1.) Update the /etc/init.d/ssh file to include debug option.


#diff /etc/init.d/ssh /etc/init.d/ssh.orig

30d29
< SSHD_OPTS="$SSHD_OPTS -ddd"
#

2.) Start the ssh services in the server.

# service ssh --full-restart
Stopping OpenBSD Secure Shell server: sshd.
Starting OpenBSD Secure Shell server: sshddebug1: sshd version OpenSSH_5.5p1 Debian-6+squeeze5
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
.....
.....



SSH Client :

2.) Start the ssh client with verbose options enabled.


$ ssh -vvv USERNAME@SERVER_IP_ADDRESS
OpenSSH_5.5p1 Debian-6+squeeze5, OpenSSL 0.9.8zc 15 Oct 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to SERVER_IP_ADDRESS port 22.
debug1: Connection established.
debug1: identity file /h/palsarav/.ssh/id_rsa type -1
debug1: identity file /h/palsarav/.ssh/id_rsa-cert type -1
debug1: identity file /h/palsarav/.ssh/id_dsa type -1
debug1: identity file /h/palsarav/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze5
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze5
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss


Reference :
1.)
sshd(8) - Linux man page 

Synopsis
sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-f config_file] [-g login_grace_time] [-h host_key_file] [-k key_gen_time] [-o option] [-p port] [-u len]
 
sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these programs replace rlogin(1) and rsh(1), and provide secure encrypted communications between two untrusted hosts over an insecure network.
sshd listens for connections from clients. It is normally started at boot from /etc/rc. It forks a new daemon for each incoming connection. The forked daemons handle key exchange, encryption, authentication, command execution, and data exchange.

-d'
 Debug mode. The server sends verbose debug output to the system log, and does not put itself in the background. The server also will not fork and will only process one connection. This option is only intended for debugging for the server. Multiple -d options increase the debugging level. Maximum is 3.

2.)
SSH(1)                                                             BSD General Commands Manual                                                            SSH(1)

NAME
     ssh â OpenSSH SSH client (remote login program)

SYNOPSIS
     ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D  [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11]
         [-i identity_file] [-L  [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R
         [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] [user@]hostname [command]

      -v      Verbose mode.  Causes ssh to print debugging messages about its progress.  This is helpful in debugging connection, authentication, and configuraâ
             tion problems.  Multiple -v options increase the verbosity.  The maximum is 3.

Thursday, February 21, 2013

Must Have Firefox Add-ons



Firefox is my favorite browser.
Here, I listed my favorite Firefox Add-ons.

https://addons.mozilla.org/en-US/firefox/collections/sarpalan/favorites/?page=1

These are the MUST have Add-ons for any Firefox user.

1.) Downloading 
  • Easy YouTube Video Downloader    - To download video from youtube.
  • Download Now                                - Quick download
  • DownThemAll!                                  - Awesome quick downloader !
  • FlashGot                                           - To download all videos in a webpage.
  • Download Statusbar                          - Mini download status bar.
  • FireFTP                                            - Nice FTP (File Transfer Protocol) interface in browser.

2.) Dictionary lookup

    Answers                                                 - (Alt + double click on any word in a webpage)
                                                                      to see the word's definition.  Very Good one.


3.) To take notes and to manage information (productivity)

  •    Evernote Web Clipper                            - To take notes from webpage and store it in Evernote.
  •    Zotero                                                    - To organise files
  •    Grocery List Generator                           - To prepare a grocery list.


4.) Privacy, Security, Blocking Ads


  •     Adblock Plus                                         - To block ads.
  •     Collusion                                               - To see the active cookies in a diagram. nice !


5.) Bookmarks and Password 
 

  •     Xmarks Sync                                        - To backup your bookmarks and password.
  •     Go Parent Folder                                  - To see where bookmark is stored in the folder hierarchy.
  •     Show Parent Folder                              - To see where bookmark is stored in the folder hierarchy.


6.) Browser & Internet Related Stuff


  •     FoxyProxy Standard                            - To switch between different network proxies quickly.
  •     IE Tab+                                               - Internet Explorer inside Firefox !
  •     Session Manager                                 -  Stores the opened tabs and session information.
  •     Broadband Speed Test and Diagnostics - Network speed test.

Monday, July 2, 2012

HP UX - Mounting NFS filesystem simple example



 Mounting the NFS filesystem: Simple Example : (Reference)

 Let me mount the '/usr/sarav' directory located in the remote SERVER machine to the local CLIENT machine in '/var/sarav_mounted' directory.

 In Server,
 1.) Add the filesystem to be mounted in /etc/exports file.
 SERVER# cat /etc/exports
 /usr/sarav
 SERVER#

 2.) Export the filesystem.
 SERVER# exportfs -a
 SERVER# exportfs
 /usr/sarav
 SERVER# cd /usr/sarav
 SERVER# ls -ltr
 total 32
 drwxrwxrwx   3 root       sys             96 Apr 25 21:13 Modules
 drwxrwxrwx   2 root       sys           8192 Apr 25 21:24 MyPrograms
 drwxrwxrwx   2 root       sys           8192 Jun  6 16:46 Scripts
 SERVER# showmount -e
 export list for SERVER:
 /usr/sarav (everyone)
 SERVER#

 In Client,
 1.) Create a directory which will be used to mount to the server side directory and mount it.
 CLIENT# mkdir /var/sarav_mounted
 CLIENT# mount -F nfs SERVER:/usr/sarav /var/sarav_mounted
 CLIENT# mount
 /var/sarav_mounted on SERVER:/usr/sarav rsize=32768,wsize=32768,NFSv3,dev=2 on Mon Jul  2 16:14:20 2012

 2.) Now access the remotely located filesystem by the mounted filesystem name as if you are accessing the local filesystem.
 CLIENT# cd /var/sarav_mounted
 CLIENT# ls -ltr
 total 32
 drwxrwxrwx   3 root       sys             96 Apr 25 21:13 Modules
 drwxrwxrwx   2 root       sys           8192 Apr 25 21:24 MyPrograms
 drwxrwxrwx   2 root       sys           8192 Jun  6 16:46 Scripts
 CLIENT#

Thursday, June 14, 2012

All SCTP RFCs Chart


All the up-to-date RFCs can be found at : http://www.rfc-editor.org/rfc-index2.html
Here, I have listed only the current SCTP RFCs and their inter-dependencies (As on June 14, 2012).
As the name implies, INFORMATIONAL RFCs are better than the PROPOSED STANDARD RFCs to understand the protocol !
RFC 4960 is the latest SCTP PROPOSED STANDARD RFC.

Definitions :
--------------
RFC  = Request For Comments
SCTP = Stream Control Transmission Protocol
...........> Extended by RFC
--------> Obsoleted by RFC

'PROPOSED STANDARD' RFCs CHART
````````````````````````````````````````````````````

    |
---+---- June 14, 2012     
    |              
    |        .....>  6526 (IP Flow Information Export (IPFIX) Per SCTP Stream - Mar 2012)
    |        .
    |        .
    |        .....>  6525 (SCTP Stream Reconfiguration - Feb 2012)
    |        .
    |        .
    |        .....>  6096 (SCTP chunk flags registration - Jan 2011)
    |        .
    |        .
    |        .....>  6083 (Datagram Transport Layer Security (DTLS) for SCTP)
    |        .                      
- Jan 2011)
    |        .
    |        .....>  5811 (SCTP-Based Transport Mapping Layer (TML) for Forwarding
    |        .             and Control Element Separation (ForCES) Protocol - Mar 2010)
    |        .
    |        .
    |        .....>  5043 (SCTP Direct Data Placement (DDP) Adaptation - Oct 2007)
    |        .
    |        .
    |        .....>  5061 (SCTP Dynamic Address Reconfiguration - Sep 2007)
    |        .
    |        .
  4960 (SCTP - Sep 2007)
    ^
    |
    |        .....>  4895 (Authenticated Chunks for the SCTP - Aug 2007)
    |        .
    |        .
    |        .....>  4820 (Padding Chunk and Parameter for the SCTP - Mar 2007)
    |        .
    |        .
    |        .....>  4168 (SCTP as Transport for Session Initiation Protocol (SIP)
    |        .                      
- Oct 2005)
    |        .
    |        .....>  3873 (SCTP Management Information Base (MIB) - Sep 2004)
    |        .
    |        .
    |        .....>  3758 (SCTP Partial Reliability Extension - May 2004)
    |        .
    |        .
    |        .....>  3554 (On the Use of SCTP with IPsec - July 2003)
    |        .
    |        .
  2960 (SCTP - Oct 2000)


[Note : RFC 3309 (SCTP Checksum change - Sep 2002) updates RFC 2960, is not showed in the above chart as it is Obsoleted by RFC 4960. ]

INFORMATIONAL RFCs
```````````````````
6458 (Sockets API Extensions for the SCTP - Dec 2011)
5062 (Security Attacks Found Against SCTP and Current Countermeasures - Sep 2007)
4460 (SCTP Specification Errata and Issues - Apr 2006)
4166 (Telephony Signalling Transport over SCTP Applicability Statement - Feb 2006)
3286 (An Introduction to the SCTP) - May 2002)

EXPERIMENTAL RFCs
``````````````````
6084 (General Internet Signaling Transport (GIST) over SCTP and Datagram Transport Layer Security (DTLS) - Jan 2011)
5827 (Early Retransmit for TCP and SCTP - May 2010)
4138  (Forward RTO-Recovery (F-RTO): An Algorithm for Detecting Spurious Retransmission Timeouts with TCP and the SCTP - Aug 2005)
3708 (Using TCP Duplicate Selective Acknowledgement (DSACKs) and SCTP Duplicate Transmission Sequence Numbers (TSNs) to Detect Spurious Retransmissions - Feb 2004)

BEST CURRENT PRACTICE
``````````````````````
6335 Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry - Aug 2011