Surely it is no good idea to log into a remote system from an untrusted computer. But sometimes it is plain necessary. Exposing an unencrypted SSH keyfile is no option of course. Entering a regular password is none either.

S/Key seems to be the "usual" solution but it requires strictly following the order of passwords on a list. This is undesirable for shared accounts as all parties would need to synchronize use of the list.

Any way to make OTPs with no requirements regarding order of usage? Other ideas?

Background: Two admins share an account. Another one should be given an "emergency envelope" that is sealed and contains information for that account. Breaking the seal is allowed only in case the other admins are unavailable.

  • This is a design question. You need one account with several authentication "items". Just like you could add several ssh pubkeys to this account and put the superlong root-password in the safe. In regards to using a second factor other than ssh keys, you need a system, that can handle this. You can use privacyIDEA as a central system, to manage the authentication devices/items of all the admins, which are assigned to this root-account. Then you can configure all your hardy-systems to authenticate against this central privacyidea.
    – cornelinux
    Commented Jul 21, 2015 at 13:19

10 Answers 10


We use OTPW for this. Simple implementation. Easy to replicate the password list. The system requests passwords by number, so no problems trying to keep the lists in sync.

  • This is exactly what I was looking for. There are even packages for Ubuntu Hardy. I would upvote, but can't (yet).
    – Paul
    Commented Aug 31, 2009 at 15:02
  • Our production systems are Hardy, so I can say with confidence that it works well on that platform. And even though you may not be able to upvote, you can "accept" the answer... :)
    – Insyte
    Commented Sep 1, 2009 at 0:31

S/Key is ideal for this scenario, but you need to do a little more work.

Create special accounts for each emergency envelope. Those accounts are added to sudoers and can assume root. That gives you the audit trail that you should have (one account per envelope, one envelope per user) and the flexibility that you need.

After an emergency, the admin has to bring back the envelope for the next password, which gives you the audit trail.

  • Not exactly what I want, but thanks for noting the missing audit trail if accounts are shared.
    – Paul
    Commented Aug 31, 2009 at 15:16
  • The assigning two logins the same UID option that Joe H. suggested is probably the best course of action then. Commented Aug 31, 2009 at 16:16

I've been a fan of Yubikey for a while now.


  • Me too. I log in to BSD, Linux and Solaris boxes with Yubikey. Cheap and awesome.
    – Thomas
    Commented Aug 30, 2009 at 10:05
  • YubiPAM provides an offline-PAM module as you would expect it. The hardware seems slick. Not clear if the necessary storage of the AES key on the target computer implies a risk to the integrity of the Yubikey (i.e. login without Yubikey can be achieved by having the AES key).
    – Paul
    Commented Aug 31, 2009 at 15:38

The issue seems to be that you're trying to use group accounts. I see two possibilities

  1. Separate logins for each user, and then have them su to the shared account.
  2. If the OS supports it, assign two logins the same UID number.

In the second case, you'll have to test what s/key thinks a user is (UID, or UID number) and if you can assign each login a separate list.

(I admit -- I've never tried #2 in Linux, but we used to use it a long time ago to give the operators an alternate shell, which was actually a menu system for them to run some fixed commands as root. These days, you'd just do it w/ sudo)


take a look at mobile-otp - it's 'cheap' soft-token you can run on java-capable mobile phone. i used it successfully only with web-apps, but as i see they have pam module as well.

alternatively there is wikid, but i never used this one.


This is an old thread but someone might stumble upon it. There are two interesting requirements:

  1. one account shared by several human beings

  2. the emergency envolope, which I think should only work one time.

LinOTP can cope with that. You can assign several different OTP tokens of different vendors to one user. (req. 1)

Additionally you may create a fixed password token. Put this in the envelope. Now comes the cool part: you can define how often a token may be used for successful authentication. So you can set this value=1 for this emergency envelope token (req. 2)


Things like Vasco Vacman provide RADIUS authentication, which you could use to log into linux using regular PAM. They require a physical token, and are pricey though, so probably don't suit your current situation.


Another strong authentication alternate would be RSA SecurID.

Pros: Many factors to choose from, from the "classic" keyfob device, to software tokens (including iPhone!) to "OnDemand" (i.e., OTP codes sent via SMS/email) that is what I would probably use for this case. (ie, you have all the "options" mentioned in the article)

Pros: Easy to integrate with almost any system, enabling strong auth into most systems

Pros: Easy to use, from the end-user POW.

Cons: Price. It's not the cheapest solution in the market.


I used to use OPIE. It asks for the passwords by number, so you know which one on the list it wants.

But now I've moved on to Yubikey.


I don't understand why the standard S/Key won't meet your requirements.

Every time someone logs in, it sends them a visible "challenge" which includes the index number of the password it wants. Enough information is given to figure out which line of a printed list of one-time-passwords is being requested ...without any sort of coordination with any other user sharing the account. (Another way to look at this is all necessary coordination is provided by the computer itself, with no need for the multiple users to ever talk to each other.) Similarly there's enough information (both the index number and the seed) to give to a program to regenerate the requested password (provided of course you know the secret).

The envelope can contain either another printed copy of the whole list of one-time passwords, or the original (non-skey) password, which still works. (Of course for maximum security, if the envelope is ever opened you want to change whatever it contained [either the sequence of OTPs or the original password].)

So skey seems to easily fulfill both requirements. Tell me again why you're searching for something different?

Not the answer you're looking for? Browse other questions tagged .