L
L
Lion2952020-11-07 12:39:50
linux
Lion295, 2020-11-07 12:39:50

Is there an easy way to generate SSH for an hour?

It is necessary to give access to a third party with root rights for 1 hour. Can this be organized in a couple of lines of the terminal?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
mureevms, 2020-11-07
@Lion295

I don’t even understand why all the previous commentators write about the key, if you need to write about the user.

adduser <username> && sleep 600 && usermod --lock <username>

or
adduser <username>
echo usermod --lock <username> | at now + 60 minutes

Do further privilege escalation as you wish.
Command example taken from stackoverflow

S
Sanes, 2020-11-07
@Sanes

And what's the point of giving it for an hour, if he can easily change it?
You can issue a key that will be deleted by the crown.

A
Alexey Cheremisin, 2020-11-07
@leahch

No, SSH uses simple crypto keys. They do not have the concept of "time", as in full-fledged PKI certificates. In other words, you either have a key or you don't.
But you can arrange this via PAM https://www.thegeekdiary.com/centos-rhel-how-to-re...

S
SOTVM, 2020-11-07
@sotvm

8-10 characters password
will not be sorted out even in a month

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question