{"id":448,"date":"2013-08-08T05:40:00","date_gmt":"2013-08-08T05:40:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/2013\/08\/08\/linux-utility-to-manage-login-to-systems\/"},"modified":"2019-09-18T15:23:08","modified_gmt":"2019-09-18T09:53:08","slug":"linux-utility-to-manage-login-to-systems","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2013\/08\/08\/linux-utility-to-manage-login-to-systems\/","title":{"rendered":"Linux Utility to manage login to systems"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">One of the problem I used to have as build &amp; release engineer is to  manage login to huge number of boxes through my Linux system. At the  scale of 5-10 machine it&#8217;s a not a big problem but once you have close  to 100+ boxes then it is not humanly possible to remember the ip&#8217;s of  those boxes.<br \/>\nThe usual approach for this problem is to maintain a reference file,  from where you map machine name with the ip &amp; find the ip of the box  from this file, but again after some time this solution seems to be not  that efficient. Another solution is to have a DNS server where you can  store such mappings &amp; then you can access these machines using their  names only, this is the idle solution but what if you don&#8217;t have DNS  server also still you have to execute the ssh command &#8216;ssh  user@machine&#8221;.<\/p>\n<p>I developed a simple solution for this problem, I created a utility  script connect.sh, this script takes machine name as an argument &amp;  then we have multiple conditions statements which checks which ssh  command to be executed for the machine name.<\/p>\n<p>#!\/bin\/bash<br \/>\nif [ &#8220;mc1&#8221; == $1 ]; then<br \/>\n&nbsp;&nbsp; &nbsp;ssh user@<br \/>\nelif [ &#8220;mc2&#8221; == $1 ]; then<br \/>\n&nbsp;&nbsp; &nbsp;ssh user@<br \/>\nelif [ &#8220;mc3&#8221; == $1 ]; then<br \/>\n&nbsp;&nbsp; &nbsp;ssh user@<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\nfi<\/p>\n<p>This solution worked really well for me as now I&#8217;m saved from executing  whole ssh command, also for machine name I&#8217;ve followed a convention i.e  <i>_<\/i> for example the entry for a  machine for release environment that is hosting an application catalog  the machine name would be <i>release_catalog<\/i>, similarly <i>dev_catalog,  staging_catalog, pt_catalog<\/i>.. so you don&#8217;t have to remember machine  names as well :).<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the problem I used to have as build &amp; release engineer is to manage login to huge number of boxes through my Linux system. At the scale of 5-10 machine it&#8217;s a not a big problem but once you have close to 100+ boxes then it is not humanly possible to remember the &hellip; <a href=\"https:\/\/opstree.com\/blog\/2013\/08\/08\/linux-utility-to-manage-login-to-systems\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux Utility to manage login to systems&#8221;<\/span><\/a><\/p>\n","protected":false},"author":171775670,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474,610],"tags":[768739285,290243,7170],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-7e","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/448"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/171775670"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":1,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":796,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/448\/revisions\/796"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}