Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
08-17-2009, 08:09 AM
|
#1
|
|
LQ Newbie
Registered: Jul 2009
Posts: 7
Rep:
|
can a password be decrypted
Hello,
I have a question. in /etc/shadow the passwords of different users are stored in encrypted form. Is there a way we can decrypt them?
Regards,
Usman Samad
|
|
|
|
08-17-2009, 08:31 AM
|
#2
|
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,780
|
There is no decryption algorithm; these are hashes (one way 'encryption').
|
|
|
|
08-17-2009, 08:40 AM
|
#3
|
|
Senior Member
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,843
Rep: 
|
You can brute force them, of course, but finding programs that do that is an exercise I leave to the OP.
|
|
|
|
08-17-2009, 08:42 AM
|
#4
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
Originally Posted by usmansamad
Hello,
I have a question. in /etc/shadow the passwords of different users are stored in encrypted form. Is there a way we can decrypt them?
Regards,
Usman Samad
|
Why?
They are encrypted so that--e.g.--you cannot look over the administrator's shoulder and get another user's password. If you have admin privileges, you can change anyone's password.
What is it that you are trying to do?
|
|
|
|
08-17-2009, 08:57 AM
|
#5
|
|
Senior Member
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,232
Rep: 
|
Look at John the Ripper the password cracker: http://www.openwall.com/john/. Some day I decided to try it. I used it on my system with three users. After a few hours of continuous work of the program I stopped it. I stated my passwords are strong enough.
|
|
|
|
08-17-2009, 09:54 AM
|
#6
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
You can't actually de-crypt them in the correct sense of the word.
John can actually find passwords that are valid matches for a given hash, which in practical terms might be the same 99% of the time, but it's not quite the same at all, and it can really take like years unless your passwords are of a very low quality.
The whole idea of storing only the hashes is, as said above, that you can't reverse them. You can only check if a given password is valid for a given hash. That's called "brute forcing", and the only shorthand is the use of a dictionary, which only works if your passwords are bad ones. A good password will never resemble anything that appears on a dictionary.
pixellany makes the real point: why? if you are not root, then you are trying to do something bad, and you will not get help here. If you are root, just change the passwords to whatever you want. You don't need the original ones. Otherwise, explain yourself.
|
|
|
|
08-17-2009, 10:06 AM
|
#7
|
|
LQ Newbie
Registered: Jul 2009
Posts: 7
Original Poster
Rep:
|
Actually i wanted to SSH few files at a server where root access was not allowed so i had to login with the user then sudo bash to access root. So it was getting a little difcult while SSH files as i didnt know root password. Thats why i asked.
Any way thnx to all of u.
|
|
|
|
08-17-2009, 10:16 AM
|
#8
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
If you don't know the root password then it's because you are not supposed to log in as root, it doesn't matter if it's ssh or local login. Really, passwords are there for a reason, if everyone could read them from /etc/passwd there would be no point at all in having them. That's why they was moved to /etc/shadow long ago, and that's why that file is not world-readable, and why passwords are hashed so they can't be de-cyphered.
If you are doing a legitimate administrative task that truly require root privileges then I am sure that you will have no problem contacting the root user and asking him for permission, or for a solution that can work for both of you.
|
|
|
|
08-17-2009, 10:52 AM
|
#9
|
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,780
|
Quote:
Originally Posted by usmansamad
Actually i wanted to SSH few files at a server where root access was not allowed so ...
|
That is to prevent brute force attacks on the root account. Every server should be setup like that.
|
|
|
|
08-17-2009, 11:20 AM
|
#10
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
Originally Posted by usmansamad
Actually i wanted to SSH few files at a server where root access was not allowed so i had to login with the user then sudo bash to access root. So it was getting a little difcult while SSH files as i didnt know root password. Thats why i asked.
Any way thnx to all of u.
|
Which leads us to conclude that you were not supposed to be doing what you were trying to do.......
If that's correct, then please do not post a question like this again.
If I have made the wrong conclusion, please explain and there will be a full apology....
Good luck regardless.... 
|
|
|
|
08-17-2009, 12:11 PM
|
#11
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
I *hope* that the fact that he can "sudo bash" means he's got
rightful access to the root account.
|
|
|
|
08-17-2009, 12:14 PM
|
#12
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
Originally Posted by Tinkster
I *hope* that the fact that he can "sudo bash" means he's got
rightful access to the root account.
|
It was not obvious, the way I read it.
To me, the "body language" says he was trying to do something he was not suppossed to.......As I said, if he clarifies this, I will totally apologize, recant, etc.........
|
|
|
|
08-17-2009, 06:58 PM
|
#13
|
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD, Ubuntu (desktop)
Posts: 3,859
Rep: 
|
Even if he's a full sudoer, the real sysadmin probably wouldn't appreciate him trying to crack root's password. (I know I wouldn't.) For that matter, he may get a stern talking to for doing things like sudo bash.
|
|
|
|
08-17-2009, 08:17 PM
|
#14
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,554
|
There are always legitimate ways to do what legitimately must be done. If you're working with remote transfer of files, you might have to move the files to the target machine, log on to that machine, and from there move them to their final location, chown them and so-forth.
These "restrictions" are imposed for a very good reason: to constrain what a not-so-nice person can potentially "do to your system from a distance." For legitimate users they are but a slight inconvenience.
"Cracking passwords" is never the right thing to do, even if you find that you can do it. The configuration of a computer system is a surprisingly delicate thing that is very easy to break; damned difficult to repair.
Last edited by sundialsvcs; 08-17-2009 at 08:18 PM.
|
|
|
|
08-17-2009, 08:48 PM
|
#15
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
Just to add that there's nothing wrong with 'sudo bash'; either you've been given rights in sudoers to do that (in which case its been blessed by the sysadmin) or you haven't, in which case it'll fail.
Definitely agree with NOT trying to crack anyone's passwd, especially root.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:47 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|