SSH Client…

Posted by sp2hari

I guess every GNU/Linux user must have sshed from one comp to another sometime or the other. We have different servers for various purposes in our college and ssh is a common thing. Most of the time, we end up typing some thing like

ssh -XCYP hari@spider.nitt.edu

Though not many knows what these options stands for, life will become very simple if you try to understand the command and create a configuration file for ssh and use it when you ssh from one box to another.

The ssh client takes the parameters from three places in the following order.

  • Command line options
  • User-specific configuration file
  • System-wide configuration file

The command line options are the one you specify when connect to other system using the ssh command. For example ssh -X specifies that X11 forwarding should be enabled.

The User specific configuration file is ~/.ssh/config.

The System wide configuration file is /etc/ssh/ssh_config. Note that the configuration file for ssh server (sshd_server) is also found in this folder. The file ssh_config is the configuration file for the ssh client while sshd_config is the configuration file for the server.

Any configuration value is only changed the first time it is set. So if you run the ssh command with X option, X11 will be forwarded no matter what values ~/.ssh/config and /etc/ssh/ssh_config file has. The values are parsed in the order mentioned above.

The User config file gives users the choices to configure ssh client when you ssh often. A config file is explained with an example below.

Host codelabs
    hostname codelabs.nitt.edu
    user hari
    ForwardX11 yes
    port 22

In the above example, very few options were added to make the config file simple. I guess that will be enough for everyone.

The config file has Host blocks. The properties which come under a host are set when you connect to the given to any host. In this example i have used the host machine called codelabs.nitt.edu. You can also specify * to apply to any host or 10.1.39.* to apply to all machines which comes under 10.1.39. series. Remember that the configuration values are set only once. So if * appears in the beginning of your config file, then the configurations which come below that may not be used by the ssh client. For example consider the following configuration file.
Host *.edu
    ForwardX11 yes

Now in the above case when you connect to any server which ends with .edu (spider.nitt.edu, codelabs.nitt.edu …) then the X is forwarded. But if you want to diasable X11 forwarding for spider.nitt.edu, then the following won’ t work

Host *.edu
    ForwardX11 yes
Host spider
    hostname spider.nitt.edu
    ForwardX11 no

This is because in the first block, ForwardX11 is set to yes for all hosts ending with .edu and then it can’t be changed. The correct way to block X11 forwarding for spider is to have a config file as shown below.
Host spider
    hostname spider.nitt.edu
    ForwardX11 no
Host *.edu
    ForwardX11 yes

You can tweak almost everything you need from the public key file, port, number of passwords prompts, compression, ciphers, compression level, user, tunnel, tunnel device and lots more. :) Happy sshing :-)

Conquered solaris ….

Posted by sp2hari

Got up at 4 PM :-). Yes 4 PM. Yesterday after finding out that my Ethernet card had some arbit problem, planned to buy a new one. But felt like checking my Ethernet card for the last time. Went to my friend’s place and checked my Ethernet and it worked there :-(. I was both happy and sad. Happy because my Ethernet is working, no need to buy another one and sad because now i don’t even know what is the problem with my computer. Anyway i got another Ethernet card from my friend’s computer (of course after promising her a treat).

First checked the computer with her Ethernet card. Internet worked both in Solaris and Windows. WOW :) . Now again, i checked again with my Ethernet card and WOW WOW WOW, it connected to Internet from all three OS. Now what is happening here ??? Yesterday i spent more than 7 hours trying to make this card work and now this is working out of box within 5 mins. And as such i did the same thing what i did previous night. Looks like you can never try to reason out few things.

Anyway now i am in Solaris and it is cool. First had to install new softwares. Taggy gave me the this link. And this one was also very useful. So within a matter of 5 mins, i installed most of the softwares i might need.

As such i had three main things to do in Solaris according to the mail Emily Chen sent me. They are

1. Read about tinderbox setup from http://www.mozilla.org/projects/tinderbox/ .

2. Sun Studio 11
http://developers.sun.com/sunstudio/products/previous/11/index.jsp
On Solaris, Sun Studio is used to build Firefox, not gcc, so have to install Sun Studio.

3. Set up CBE (Common Build Environment)
http://opensolaris.org/os/project/jds/contributing/building/

Now my goals were very clear. And internet from Solaris was working cool, just thought of downloading everything then, but Sun Studio was around 300 MB and already my internet bills have reached peak. So had to wait till 11 PM ( 11PM to 9 AM free internet :P) .

Started downloading at 11. 15 . OMG. It started at 7KBs and said it is gonna take 24 hrs :-(. Now i can’t do anything to this. Have to sit and wait :P . When i am writing this blog (ie 8 AM), it says only 5 hrs left.

Still network configuration has few glitches. I have to enter the DNS entries every time i reboot the system. And even though i have configured it to activate on boot, the Ethernet card has to manually activated after every time. This is strange since, i have a file called hostname.rtls0 in / (which should activate the Ethernet card on boot )

Yesterday Solaris had me. It made me frust to the core. It made me raise doubts about whether i will be able to finish SOC on time. But today is my day. I conquered :P solaris. In fact now that Solaris phobia is slowly disappearing. Now it is time to say Hello World to Tinderbox :P.

networking not working :P…

Posted by sp2hari

I have got a new phobia. Solaris phobia :P. lol.
Well how easy solaris can ruin one whole night. Though i shouldn’t blame Solaris completely but at least it deserves something for troubling me with DNS thing sometime back .

Anyway here comes the story. After discussing with Casanova about tinderbox i realized that setting up tinderbox is an important issue. So i was all set to start with tinderbox setup. But looks like fate had other plans. Anyway after discussing with Casanova ( at around 10 pm ), soon started working into tinderbox.

But once i booted into Solaris and went to Google.com, it said “Could Not Connect”. Since i have seen this error many a times already, i just went to the network manager and found all my previous entries missing there :P. Nothing unusual actually. So entered the values again and restarted networking. Now again the same old error. Since i have already configured DNS once and connected to internet from solaris, i thought the same settings will work this time also.

But noticed something strange. This time it won’t even ping to my DNS or Gateway. Well this is certainly strange. I called taggy (solaris club head :P) and explained him the situation. He gave a few solutions and i tried some other things which i found in internet. The bad part about networking not working is that even to Google or download something, you need to reboot :-( “Life is too short for reboots” they used to say.

Anyway now the time was 12 . Shit. Two hours gone and still no progress. Had a idea of going back to Firefox test cases but NO. I have to work with Tinderbox and i will do it tonight. So read manuals from here and there about configuration and tried everything given there :(. No luck. Though internet seems to work from windows and Linux.

Now one unfortunate thing is i have two Ethernet cards ( Realtek and VIA). Solaris detects only Realtek , so i use that for Solaris while i use VIA for Linux and Windows. Just then it realized. Is the Realtek Ethernet card working ??? What if that has the problem ??

So one more reboot. Configured the Realtek card to connect to internet. Widows detected the card, LAN enabled but internet was not working. Same problem as i had in solaris. SHIT SHIT SHIT. So finally my Ethernet card has some problem :-(. The strange thing is, it detects my card and all, but just that it wont send/receive anything through the card. Strange problem, but why to me :-( :-(

After realizing the problem (well time is 3 am now), i thought of finding the driver for the VIA Ethernet card, and managed to download a driver. A reboot back to Solaris, i realized that i don’t even have a gcc to compile the driver. Downloaded gcc and finally now it is 5 am :-(

I am NOT going to try installing the driver for VIA Ethernet card. I am getting frustrated , irritated and what not,when i see a reboot. A 60-75 reboots in a span of 7 hours is not something really exciting and motivating :(. So all i am gonna do is to check this Ethernet card in friends place and get a new one.

Finally when i wrote this blog it is 5 AM. From 10 PM to 5 AM, no progress at all. All i found out is my Ethernet card might not be working :( :( . Not even a single line of Code in 7 hrs of real hard working :-(, actually not even a single word of code :P .
A nightout is nothing new for me, but this time i really felt the pain of one whole night completely wasted :(.

Now all i hope is my Ethernet card should have a problem, so that i can get another one soon and start with my work. Only God can save me if it was not an Ethernet problem :P.

FireStats icon Powered by FireStats