- You have a software rollout for <PRODUCT>, which must be installed as UID <PRODUCT>.
- Sudo says you aren’t cleared to run any command as <PRODUCT UID> on the target host.
- The admins are all out sick.
- The developer is on vacation.
- The target host is going live for <PRODUCT> in 30 minutes
ready-or-not.
NO FEAR…
… if you have sudo chmod privileges and know something neat about SSH user keys.
-
- Create an SSH key on your local box if you don’t have one already.
- Connect to the target box, and cd to ~product.
- If
~product/.sshexists, change permissions on it to allow you to read and write. Otherwise, create~product/.ssh - Now
cd .sshandchmod authorized_keys(YMMV) to o+w. - Append your public key to the authorized_keys file.
- Restore permissions on authorized_keys
- Go up to
~productand restore permissions on.ssh - From your local box:
ssh <PRODUCT>@target_host
If you reset permissions correctly, you have just connected directly as the target product ID.
Admins: please remember this is why sudo su can be a bad thing. Want to find these people?
Advertisement