Local script is working fine. when I run ifconfig It's not working
What you mean that ifconfig is not working? You get an error from sudo, or what? Please try to be more specific, so we can help you.
Also you didn't mention the Linux distribution you're using.
Re: pinga's link, it's 4-5 posts before.
Anyway you can try to run tomcat using your username, so you won't need sudo. Log-in the server, become root and run:
chown -R bhaumik /opt/tomcat/6.0.29/apache-tomcat
Then logout and run from your host the ssh command without the sudo
ssh remoteserver /opt/tomcat/6.0.29/apache-tomcat/bin/remote.sh
and see if it works.