LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 08-17-2009, 08:09 AM   #1
usmansamad
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
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
 
Old 08-17-2009, 08:31 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
There is no decryption algorithm; these are hashes (one way 'encryption').
 
Old 08-17-2009, 08:40 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
You can brute force them, of course, but finding programs that do that is an exercise I leave to the OP.
 
Old 08-17-2009, 08:42 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by usmansamad View Post
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?
 
Old 08-17-2009, 08:57 AM   #5
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
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.
 
Old 08-17-2009, 09:54 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
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.
 
Old 08-17-2009, 10:06 AM   #7
usmansamad
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 08-17-2009, 10:16 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
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.
 
Old 08-17-2009, 10:52 AM   #9
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by usmansamad View Post
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.
 
Old 08-17-2009, 11:20 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by usmansamad View Post
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....
 
Old 08-17-2009, 12:11 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
I *hope* that the fact that he can "sudo bash" means he's got
rightful access to the root account.
 
Old 08-17-2009, 12:14 PM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by Tinkster View Post
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.........
 
Old 08-17-2009, 06:58 PM   #13
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 08-17-2009, 08:17 PM   #14
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,363

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
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.
 
Old 08-17-2009, 08:48 PM   #15
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GNOME: Gain privileges using current user's password instead of root's password maxkukartsev Fedora 5 02-10-2012 09:46 AM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
Help requried to write the decrypted ipsec packets to the local disk. ahm_irf Linux - Security 3 02-22-2007 06:07 PM
encrypted files, decrypted fictive drives diano Linux - Security 2 12-18-2006 02:06 PM
GnuPG - best permissions & security of decrypted file - help please emuub Linux - Security 1 10-14-2005 05:28 PM


All times are GMT -5. The time now is 02:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration