Security Basics mailing list archives
Re: Root account desactivated
From: Patrice Neff <mailinglists () patrice ch>
Date: Sat, 13 Mar 2004 17:32:41 +0900
sil <jesus () resurrected us> writes:
sudo sed 's/\/sbin/\/nologin/\/bin\/bash/g' /etc/passwd >> /tmp/passwd|\ mv /tmp/passwd /etc/passwd
This will in fact now work. First the sed script contains a small mistake. But more important, only the call of sed is executed as root, everything else (including the redirect into /tmp/passwd) is executed as a non-privileged user. If you actually choose this approach, you only have to sudo the mv statement. This is what your statement gives me on my machine: $ sudo sed 's/\/sbin\/nologin/\/bin\/bash/g' /etc/passwd >> /tmp/passwd;\
mv /tmp/passwd /etc/passwd
mv: overwrite `/etc/passwd', overriding mode 0644? y mv: cannot move `/tmp/passwd' to `/etc/passwd': Permission denied $ Regards Patrice -- Jesus answered, "I am the way and the truth and the life. No one comes to the Father except through me." (The Bible, John 14:6) --------------------------------------------------------------------------- Ethical Hacking at the InfoSec Institute. Mention this ad and get $545 off any course! All of our class sizes are guaranteed to be 10 students or less to facilitate one-on-one interaction with one of our expert instructors. Attend a course taught by an expert instructor with years of in-the-field pen testing experience in our state of the art hacking lab. Master the skills of an Ethical Hacker to better assess the security of your organization. Visit us at: http://www.infosecinstitute.com/courses/ethical_hacking_training.html ----------------------------------------------------------------------------
Current thread:
- Root account desactivated MARTIN M. Bénoni (Mar 11)
- Re: Root account desactivated sil (Mar 11)
- Re: Root account desactivated Paul Mohr (Mar 12)
- Re: Root account desactivated sil (Mar 12)
- Re: Root account desactivated Michael Gale (Mar 12)
- Re: Root account desactivated Dan Trainor (Mar 12)
- Re: Root account desactivated - confirmed Alvin Oga (Mar 12)
- Re: Root account desactivated Michael Gale (Mar 12)
- Re: Root account desactivated Patrice Neff (Mar 15)
- Re: Root account desactivated Paul Mohr (Mar 12)
- Re: Root account desactivated Ansgar -59cobalt- Wiechers (Mar 12)
- Re: Root account desactivated Paul Mohr (Mar 12)
- Re: Root account desactivated mike (Mar 12)
- Re: Root account desactivated Adam Brewster (Mar 12)
- Re: Root account desactivated Torry Crass (Mar 12)
- Re: Root account desactivated Leif Ericksen (Mar 12)
- Re: Root account desactivated Suramya Tomar (Mar 12)
- Re: Root account desactivated Mike Dresser (Mar 12)
- Re: Root account desactivated Andreas (Mar 12)
- Re: Root account desactivated Andreas (Mar 12)
(Thread continues...)
- Re: Root account desactivated sil (Mar 11)