Консольный менеджер ssh сессий

Когда количество серверов начинает зашкаливать, возникает необходимость их организовать. Каждый раз забивать ip адрес нет никакого желания, особенно если делаешь это по 50 раз за день. К сожалению функции стандартного Терминал-а мне не подошли, так как времени на открытие новой сессии через стандартное меню уйдет даже больше, чем если набирать “ssh [email protected] -p3322”. За насколько минут я написал небольшой скрипт, который выводит список серверов с возможностью выбора к какому нужно подключиться. Выглядит это примерно так:

servers

В данном примере если сервер выбран из подсети 192.173.0. – подключение будет по порту 3322. Сам скрипт, который вы можете доработать по своему желанию такой:
#!/bin/sh
ARRAY=('192.168.0.100' '192.173.0.1' '192.173.0.163' '192.173.0.166' '192.173.0.167' '192.173.0.168' '192.173.0.169')
SERVERS=${#ARRAY[@]}
echo "Выбери сервер:"
for (( i=0;i<$SERVERS;i++)); do
    echo $i\) ${ARRAY[${i}]}
done 

read choice

echo "Соединяемся с ${ARRAY[${choice}]}"
net=$(echo ${ARRAY[${choice}]} | awk 'BEGIN {FS="."} {print $1"."$2"."$3"."}')
if [ $net == "192.173.0." ]; then
ssh r[email protected]${ARRAY[${choice}]} -p3322
else
ssh [email protected]${ARRAY[${choice}]}
fi
done

Когда количество серверов начинает зашкаливать, возникает необходимость их организовать. Каждый раз забивать ip адрес нет никакого желания, особенно если делаешь это по 50 раз за день. К сожалению функции стандартного Терминал-а мне не подошли, так как времени на открытие новой сессии через стандартное меню уйдет даже больше, чем если набирать "ssh [email protected] -p3322". За насколько минут я написал небольшой скрипт, который выводит список серверов с возможностью выбора к какому нужно подключиться. Выглядит это примерно так:

servers

В данном примере если сервер выбран из подсети 192.173.0. - подключение будет по порту 3322. Сам скрипт, который вы можете доработать по своему желанию такой:
#!/bin/sh
ARRAY=('192.168.0.100' '192.173.0.1' '192.173.0.163' '192.173.0.166' '192.173.0.167' '192.173.0.168' '192.173.0.169')
SERVERS=${#ARRAY[@]}
echo "Выбери сервер:"
for (( i=0;i<$SERVERS;i++)); do
    echo $i\) ${ARRAY[${i}]}
done 

read choice

echo "Соединяемся с ${ARRAY[${choice}]}"
net=$(echo ${ARRAY[${choice}]} | awk 'BEGIN {FS="."} {print $1"."$2"."$3"."}')
if [ $net == "192.173.0." ]; then
ssh [email protected]${ARRAY[${choice}]} -p3322
else
ssh [email protected]${ARRAY[${choice}]}
fi
done

100 комментариев к “Консольный менеджер ssh сессий

  1. Hello there! I know this is kinda off topic nevertheless I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest authoring a blog article or vice-versa?
    My blog addresses a lot of the same topics as yours and I
    think we could greatly benefit from each other. If you are interested feel free to shoot
    me an e-mail. I look forward to hearing from you! Awesome blog by the way!
    cheap flights 31muvXS

  2. Hello There. I found your blog using msn. This is an extremely well written article.
    I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post.
    I will certainly comeback. 34pIoq5 cheap flights

  3. I have been surfing online more than 4 hours today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. Personally, if all website owners and bloggers
    made good content as you did, the net will be much more useful than ever before.

  4. Very good blog you have here but I was wanting to know if you knew of any forums that cover the same topics talked about here?
    I’d really like to be a part of group where I can get suggestions from other knowledgeable people that share the
    same interest. If you have any suggestions, please
    let me know. Thanks a lot!

  5. Generally I do not read post on blogs, however I
    wish to say that this write-up very compelled me to take a look at and
    do so! Your writing taste has been surprised me.

    Thanks, very nice article.

  6. An interesting discussion is worth comment. I do think that you need to write more about this issue, it might
    not be a taboo matter but usually folks don’t speak about such topics.
    To the next! Kind regards!!

  7. Hey I know this is off topic but I was wondering if you knew of
    any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time
    and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy
    reading your blog and I look forward to your new updates.

  8. Greate post. Keep posting such kind of info on your page.
    Im really impressed by your site.
    Hi there, You’ve done an excellent job. I’ll definitely digg
    it and in my opinion recommend to my friends.
    I am confident they’ll be benefited from this web site.

  9. I was suggested this web site by my cousin. I am not
    sure whether this post is written by him as nobody else know such
    detailed about my trouble. You are wonderful!

    Thanks!

  10. I blog frequently and I really thank you for your content.
    This great article has really peaked my interest. I’m going to bookmark your
    website and keep checking for new details about once a week.
    I opted in for your Feed too.

  11. Do you have a spam problem on this website; I also am a blogger,
    and I was curious about your situation; we have developed some nice procedures and we are looking to swap techniques with other folks, why not shoot me an e-mail if interested.

  12. Howdy exceptional blog! Does running a blog such as this
    require a great deal of work? I have no knowledge of programming
    however I had been hoping to start my own blog in the near future.
    Anyways, if you have any recommendations or tips for new blog owners please share.
    I know this is off topic nevertheless I simply needed to ask.
    Kudos!

  13. When someone writes an article he/she retains the thought
    of a user in his/her mind that how a user can understand it.

    Thus that’s why this piece of writing is perfect. Thanks!

  14. Please let me know if you’re looking for a writer for your blog.
    You have some really good articles and I think I would be a good
    asset. If you ever want to take some of the load off, I’d really
    like to write some articles for your blog in exchange for a
    link back to mine. Please blast me an e-mail if
    interested. Cheers!

  15. Hey there! Someone in my Facebook group shared this site with us so
    I came to take a look. I’m definitely enjoying the information. I’m bookmarking and will be
    tweeting this to my followers! Fantastic blog and wonderful style and design.

  16. I simply want to mention I am all new to blogging and truly loved this blog site. Most likely I’m likely to bookmark your website . You absolutely have wonderful article content. Appreciate it for revealing your web-site.

  17. I am just planning to start out my personal blog page soon, but I am just a bit lost on anything. Would you recommend starting up with a free program like WordPress or move for a paid alternative? There are so several choices on the market that Now i’m completely confused. Any ideas? Thanks a lot.

  18. Awesome site you have here but I was curious if you knew of any message boards that cover the same topics talked about here? I’d really like to be a part of group where I can get opinions from other experienced people that share the same interest. If you have any suggestions, please let me know. Bless you!

  19. you are actually a just right webmaster. The
    web site loading speed is amazing. It seems that you’re doing any distinctive trick.
    Moreover, The contents are masterwork. you’ve performed a excellent job
    in this topic!

  20. Wonderful goods from you, man. I’ve be mindful your stuff
    previous to and you’re just too wonderful. I really like what you’ve obtained here, really like what you’re saying
    and the way in which by which you assert it. You are making it entertaining and you continue to
    care for to keep it smart. I can not wait to read far more from
    you. This is actually a terrific web site.

  21. My companion and I stumbled above here different website in addition to thought I might simply because well check things out there. I like the items i see so today I’m following you. Seem forward to checking out there your on line webpage repeatedly.

  22. It is appropriate time to make some plans for the future and it’s time to be happy.
    I’ve read this post and if I could I desire to suggest you few
    interesting things or suggestions. Perhaps you can write next articles referring to this article.
    I desire to read more things about it!

  23. I’m not sure where you are getting your info, but good topic. I needs to spend some time learning more or understanding more. Thanks for magnificent info I was looking for this information for my mission.

  24. It’s the best time to make some plans for the future and
    it is time to be happy. I have read this post and if I could
    I want to suggest you some interesting things or tips.
    Perhaps you could write next articles referring to this article.
    I want to read more things about it!

  25. Usually I don’t read article on blogs, however I would like to
    say that this write-up very pressured me to check out and do so!
    Your writing taste has been amazed me. Thanks, quite great article.

  26. I just want to mention I’m beginner to weblog and honestly enjoyed you’re web site. More than likely I’m going to bookmark your blog . You amazingly come with remarkable stories. Thanks a bunch for sharing your web page.

  27. Thank you for some other informative site. The place else could I
    am getting that type of information written in such an ideal approach?

    I’ve a challenge that I’m simply now working on, and I’ve been at the look out for such information.

  28. whoah this blog is wonderful i love reading your posts. Keep up the good work! You know, lots of people are looking around for this information, you could help them greatly.

  29. I really like your blog.. very nice colors & theme.
    Did you make this website yourself or did you hire someone to do it
    for you? Plz answer back as I’m looking to create my own blog and would
    like to know where u got this from. thank you

  30. I am just commenting to let you know what a perfect discovery my cousin’s child obtained going through your web page. She noticed a good number of pieces, which included what it is like to have a marvelous helping heart to make other people completely have an understanding of some complicated things. You truly did more than people’s expected results. Thanks for providing those powerful, trustworthy, revealing and also unique guidance on this topic to Jane.

  31. I simply want to mention I’m very new to blogging and seriously liked your web-site. Likely I’m planning to bookmark your blog . You amazingly come with really good writings. With thanks for sharing your blog.

  32. Comfortabl y, the post is really the freshest on this laudable topic. I suit in with your conclusions and can thirstily look forward to your next updates. Simply saying thanks can not simply be enough, for the fantasti c clarity in your writing. I definitely will correct away grab your rss feed to stay abreast of any kind of updates. Great work and also much success in your business dealings!

  33. Wow that was unusual. I just wrote an very long comment but
    after I clicked submit my comment didn’t appear. Grrrr…
    well I’m not writing all that over again. Anyways, just
    wanted to say superb blog!

  34. A motivating discussion is definitely worth comment. There’s no doubt that that you should publish more on this subject matter, it may not be a taboo subject but typically people don’t discuss these topics. To the next! All the best!

  35. Greetings, There’s no doubt that your blog might be having internet browser compatibility problems. Whenever I take a look at your blog in Safari, it looks fine but when opening in I.E., it’s got some overlapping issues. I just wanted to give you a quick heads up! Other than that, excellent blog!

  36. Right here is the right website for everyone who hopes to find out about this topic. You know a whole lot its almost hard to argue with you (not that I really will need to…HaHa). You definitely put a new spin on a topic which has been discussed for decades. Excellent stuff, just excellent.

  37. Уведомление: URL
  38. I seriously love your blog.. Very nice colors & theme. Did you develop this site yourself? Please reply back as I’m planning to create my own website and would like to learn where you got this from or what the theme is named. Cheers.

  39. certainly like your web site but you need to test the spelling on several of your posts. A number of them are rife with spelling issues and I find it very bothersome to inform the reality however I’ll definitely come back again.

  40. Oh my goodness! Amazing article dude! Thank you so much, However I am encountering troubles with your RSS. I don챠t know why I cannot subscribe to it. Is there anyone else having similar RSS issues? Anyone who knows the solution will you kindly respond? Thanx!!

  41. I am typically to blogging and that i really appreciate your site content. This great article has really peaks my interest. My goal is to bookmark your site and maintain checking for brand spanking new data.

  42. Hello there! I could have sworn I’ve visited this web site before but after browsing through a few of the articles I realized it’s new to me. Nonetheless, I’m definitely delighted I stumbled upon it and I’ll be bookmarking it and checking back frequently!

  43. Hello There. I discovered your weblog the use of msn. That is a very smartly written article.
    I will be sure to bookmark it and come back to read extra of your
    useful information. Thank you for the post. I will certainly
    comeback.

  44. You’re so cool! I don’t think I’ve truly read anything like that before.

    So wonderful to discover somebody with some genuine thoughts on this issue.
    Really.. thanks for starting this up. This website is one thing that is required on the
    web, someone with some originality!

  45. There are some interesting points in time on this article but I don’t know if I see all of them heart to heart. There’s some validity however I will take hold opinion till I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as nicely

  46. I have not checked in here for some time since I thought it was getting boring, but the last several posts are good quality so I guess I¡¦ll add you back to my daily bloglist. You deserve it my friend 🙂

  47. Just desire to say your article is as surprising. The clearness to your put up is simply nice and i could assume you are a professional on this subject. Well with your permission allow me to seize your feed to stay up to date with drawing close post. Thanks one million and please keep up the enjoyable work.|

  48. I’m speechless. This is a very good blog and really attractive too. Nice work! That’s now not in reality so much coming from an beginner publisher like me, but it’s all I may just say after diving into your posts. Nice grammar and vocabulary. No longer like other blogs. You truly understand what you?re talking about too. Such a lot that you made me wish to discover more. Your weblog has transform a stepping stone for me, my friend.

  49. There are actually a variety of particulars like that to take into consideration. That may be a great level to deliver up. I provide the ideas above as normal inspiration however clearly there are questions just like the one you deliver up where a very powerful thing can be working in sincere good faith. I don?t know if finest practices have emerged round things like that, however I’m sure that your job is clearly identified as a good game. Each girls and boys feel the impression of just a moment’s pleasure, for the rest of their lives.

Оставить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *