Thursday, December 10, 2009

FreeBSD - enable su for users.

While tinkering with freeBSD it convinced of its abilities qualifing as development box. Well at home FreeBSD runs over Fedora (in VirtualBox - Bridged Networking mode) and i can ssh to it both from desktop and laptop. But its really a wonder that FreeBSD denies root access remotely (aka. ssh). One easy and rather non-acceptable way is to allow root to login ( enter PermitRootLogin in /etc/ssh/sshd_config ), but it breaks the whole secure feature of FreeBSD.
The optimim way is to add a user to do 'su' which later can be used to remote login.

Steps to add user to root group (wheel).
# pw user mod -G wheel
# groups

For new users just add it to wheel along with default group while doing adduser.


Next you can allow su for all users.
Follow these steps.
# vi /etc/pam.d/su

and look for
'auth requisite pam_wheel.so no_warn auth_as_self noroot_ok exempt_if_empty' and comment it.

Happy sshing. "_"

Friday, March 6, 2009

TCP Header.

Learn this for if you are into networking.


0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

TCP Header Format

Note that one tick mark represents one bit position.

Details http://tools.ietf.org/html/rfc793#section-3.1