Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

key based ssh authentication

APC UPS Data Center & Enterprise Solutions Forum

Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • APC UPS, Critical Power, Cooling and Racks
  • APC UPS Data Center & Enterprise Solutions Forum
  • key based ssh authentication
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
BillP
Administrator BillP Administrator
5060
voidstar_apc
Janeway voidstar_apc
196
Erasmus_apc
Sisko Erasmus_apc
112
TheNotoriousKMP_apc
Sisko TheNotoriousKMP_apc
108
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to APC UPS Data Center & Enterprise Solutions Forum
Solved
Anonymous user
Not applicable

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

0 Likes
4
3935
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

key based ssh authentication

I have a number of 8xxx series PDUs. I want to write bash scripts to collect information from them. Is it possible to authorize an ssh key for a management card user so that it can connect without a password. Ideally I want to create a readonly type user on each device and authorize that user to authenticate with an ssh key instead of a password.

I can use either a local user account or I could configure radius. A ssh key solution for either type would work for me.  (either uploading the ssh key to the device or having RADIUS provide the ssh key)

Also, it seems that when I it does not accept scripted command via ssh. for example, "ssh @ system"  reports "Connection to closed by remote host." after I type the password.  I wonder if I have to invoke the command differently than when typing it in an interactive shell. something like "... 'run system'" for example.

Most devices are currently running 5.1.6 and I am in the process of upgrading them to 633 (I think that is 6.0.33 -- the current release)

In the 6.x documentation I saw references to scripting via the command line interface. What is the typical way to do that?

--BobG

Labels
  • Labels:
  • Racks, Rack Accessories, & Cooling
  • Tags:
  • ap8641
  • command
  • line
  • management
  • network-management-card
  • password
  • pdu
  • script
  • scripting
  • ssh
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Anonymous user
Not applicable

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

0 Likes
1
3934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

FYI, I have written a BASH library that manipulates ssh to communicate with the APC gen 2 management cards that are in the 8xxx series pdus.  If anyone is interested in getting it, PM me.

Here is an example script that would run a command passed to it and display the results. The library has the default passwords hard coded for the known usernames. If you specify a different username, it prompts you to enter the password. It would make sense to leave the readonly password to the default and change the others so that the script could be used without any password for readonly access but for users you add, it would prompt for a  passowrd. Of course you could choose to hard code your admin password in your scripts too. 

I will also add methods to the APCPDU class to manipulate outlets, etc...

        cat pduRun

        #!/bin/bash
        #usage: pduRun
        source bg_APCPDU.sh

        device="${1:-$myPDU.example.com}"; [ $# -gt 0 ] && shift
        username="${1:-readonly}"; [ $# -gt 0 ] && shift

        declare -A pdu=()
        ConstructObject APCPDU pdu "$device"
        $pdu.connect "$username" "$promptForPass"
        $pdu.execCommand "$*"
        echo "$($pdu.get buf)"
        $pdu.disconnect

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 4
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

0 Likes
0
3934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

Hi Bob,

We don't support key based authentication at this time unfortunately. And so that second question doesn't work either as you have to be logged in to issue commands. I will inquire more about key based authentication but I don't think we plan to implement it in the immediate future.

The scripting help we have is just a guide to the command line interface (and also mentions SNMP as an option) -> http://www.apc.com/support/index?page=content&country=ITB〈=en&locale=en_US&id=FA156163

And yes, for the AP8XXX series/models of PDU, AOS (APC OS) 6.3.2 /rpdu2g APP 6.3.3 is the latest. We'll be coming out with a new rev shortly (AOS 6.3.3 I think) with some security changes but the answers to your questions won't change with that release. We are removing RC4 ciphers, providing TLS 1.2, SHA-2 hash signatures, etc.

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

0 Likes
0
3934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

Thank you for your quick response. Disappointing, but at least I know.

I hope to see a more complete sshd implementation on these devices in the future.

--BobG

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

0 Likes
1
3935
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-07-09 04:03 AM . Last Modified: ‎2024-02-14 11:13 PM

FYI, I have written a BASH library that manipulates ssh to communicate with the APC gen 2 management cards that are in the 8xxx series pdus.  If anyone is interested in getting it, PM me.

Here is an example script that would run a command passed to it and display the results. The library has the default passwords hard coded for the known usernames. If you specify a different username, it prompts you to enter the password. It would make sense to leave the readonly password to the default and change the others so that the script could be used without any password for readonly access but for users you add, it would prompt for a  passowrd. Of course you could choose to hard code your admin password in your scripts too. 

I will also add methods to the APCPDU class to manipulate outlets, etc...

        cat pduRun

        #!/bin/bash
        #usage: pduRun
        source bg_APCPDU.sh

        device="${1:-$myPDU.example.com}"; [ $# -gt 0 ] && shift
        username="${1:-readonly}"; [ $# -gt 0 ] && shift

        declare -A pdu=()
        ConstructObject APCPDU pdu "$device"
        $pdu.connect "$username" "$promptForPass"
        $pdu.execCommand "$*"
        echo "$($pdu.get buf)"
        $pdu.disconnect

Reply

Link copied. Please paste this link to share this article on your social media post.

JorgeOjcius
JorgeOjcius
Cadet

Posted: ‎2024-05-18 02:03 AM

In response to Anonymous user
0 Likes
0
1807
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2024-05-18 02:03 AM

Hello Bob
Could you send me the scripts/library please?
Thank you

  • Tags:
  • APC - Scripts
Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of