Tuesday, March 27, 2012

RHEL stop x-server

Very simple. According to the generic runlevel specification, you just have to change to runlevel 3. (Typical systems start in runlevel 5 because of the GUI)

Typical Linux runlevels
IDNameDescription
0HaltShuts down the system.
1Single-User ModeMode for administrative tasks.[2][3]
2Multi-User ModeDoes not configure network interfaces and does not export networks services.[4]
3Multi-User Mode with NetworkingStarts the system normally.[5]
4Not used/User-definableFor special purposes.
5Start the system normally with appropriate display manager. ( with GUI )As runlevel 3 + display manager.
6RebootReboots the system.

How to do it?

# init 3  (as root. And that's it!)

Curiosity

Lately, many systems have migrated to Upstart which is "an event-based replacement for the traditional init daemon — the method by which several Unix-like computer operating systems perform tasks when the computer is started. It was written by Scott James Remnant, a former employee ofCanonical Ltd." (source: Wikipedia)

It was firstly introduced in Ubuntu 6, and was recently adopted by RedHat to its Enterprise Linux (RHEL) as well, being therefore available in dependent distributions like Scientific Linux and Centos.

Wednesday, March 14, 2012

Simple VPN via SSH using SHUTTLE

Have you ever wanted to connect to a remote network? Sure u did. VPN?
What if your workplace doesnt offer VPN services? Or the remote is just your home, you won't install a VPN server. Or simply you wouldnt like to setup a vpn client!


Shuttle comes to help you:
"What's sshuttle? It's a Python app that makes use of SSH to create a on-the-fly VPN between your Linux, BSD, or Mac OS X machine and a remote system that has SSH access and Python."

https://github.com/apenwarr/sshuttle


This is how you use it:
If you would also like your DNS queries to be proxied through the DNS server of the server you are connect to:
./sshuttle --dns -vr username@sshserver 0/0

"Any TCP session you initiate to one of the proxied IP addresses will be captured by sshuttle and sent over an ssh session to the remote copy of sshuttle, which will then regenerate the connection on that end, and funnel the data back and forth through ssh. "