Programming :: Replace A Hash In A Shadow File Not Using Passwd?

Aug 5, 2010

What is the easiest way to replace a hash in a shadow file for one particular user, not using passwd, and when the current password is unknown?

View 3 Replies


ADVERTISEMENT

General :: Deleted Root From Passwd And Shadow File

Oct 7, 2010

I deleted root from passwd and shadow file.Can I crate a new root user?

View 1 Replies View Related

Ubuntu :: Filed Of /etc/passwd File Is The Login_shell \ Replace It To /usr/bin/date?

Jun 22, 2010

the last filed of /etc/passwd file is the login_shell;how if I replace it to /usr/bin/date
what would it happen.by the way I try to use $ subut do't know the password.what s the default root passworf for ubuntu

View 9 Replies View Related

Software :: Convert An MD5 Hash Into Shadow Format?

Nov 28, 2010

I am trying to use John the Ripper but it doesn't take regular MD5 hashes, only shadow MD5 hashes. For example this hash: 900150983cd24fb0d6963f7d28e17f72 (which, decrypted, is 'abc') within a text file, John the Ripper does not detect because it is not shadow format. How can I convert this MD5 hash into shadow format?

View 1 Replies View Related

General :: Create Shadow Pasword Hash Manually?

Oct 14, 2010

How to create the password hash exactly the same as in shadow file (from the command line)?

The command
openssl passwd -crypt
returns something different.

View 6 Replies View Related

Security :: User Appear In /etc/shadow And Not /etc/passwd

Jul 28, 2010

In what cases would a user appear in /etc/shadow and not /etc/passwd

View 2 Replies View Related

General :: Useradd Command To Create Passwd / Shadow & Other Files Under Different Directory

May 19, 2011

I am bulding my own image based on 2.6.32 kernel, I wish to add a guest user:

In a script thats invoked by the makefile, I use 'useradd' command & this updates the shadow, passwd files under /etc on the host, is it possible to tell the command to create the shadow / password under some other folder on the host? may be /tmp?

View 2 Replies View Related

Software :: Check A String With Actual User Passwd (ie Password In /etc/shadow)?

Sep 24, 2009

I am trying to write a remote access module. Is there any function in linux where I can give string (password entered by user) and compare it with the actual user password stored in /etc/shadow. Since the password is stored encrypted in /etc/shadow I cannot parse and compare. So I want some method to compare if my user entered the correct password..Is there any function for that..

View 6 Replies View Related

CentOS 5 Server :: FreeRadius Simple Shadow / Passwd UNIX System Authentication

Nov 7, 2010

Its 2 weeks i'm trying to configure freeradius2 on centos5 64bit after installed it from yum.all seems working, but i cant authenticate unix users.after digging in many sites its simply cant find user name and password ( ++[unix] returns notfound )Also how can i paste here all the radiusd -X log lines? i can't find any
radius.log file.

View 10 Replies View Related

Programming :: Script To Evaluate If A Passwd File Has Changed

Apr 6, 2010

creating a script which evaluates whether or not the passwd file has changed.

View 4 Replies View Related

Networking :: Getent Shadow Works But Getent Passwd Does Not?

Apr 4, 2011

I have been working on Kerberos and Ldap Authentication on SUSE 11.3.

I was successful with Kerberos authentication and had no issue. then i moved to configure LDAP as i want to configure this authentication method for APACHE server.

Now after configuring ldap and pam, I am able to check the command 'getent shadow' with no issue and this command lists all the users of that OU too. but when i try getent passwd or getent group , it results nothing but local users.

View 1 Replies View Related

Programming :: Perl Find File And Then Replace String In File

Jul 28, 2009

I have script that I'm working on that updates a username in all the files that are called blah.inc for my framework. since i host a bunch of these web apps i need to do it to all of them. so I need to figure out how to update these files automagically with out me watching it to call vim every time. heres what I have so far

Code:

This finds the files but now i need to figure out how to do s/bob/fred/g on those files.

View 5 Replies View Related

Programming :: Using File As Replace In Sed

Mar 1, 2011

I have a file, "outfile" what I wish to insert into a file called template where it finds "OVERRIDES". I am getting an error.

Code:

However I can do something like this and it works fine

Code:

I am guessing its because of the file size or multiple lines.

A sample of the outfile text is below

Code:

View 9 Replies View Related

Programming :: Replace A String Within A File ?

Feb 28, 2009

I've found some scripts that replaces a string in a file but it's not quite working for me.

And I'm trying to replace a tag in an xml file that looks like this

So I ran a command line like this perl -w -i -p -e "s/xmlns="'http://mydomain.org/replacethese.xsd'">/>/g" testfile.xml

And I get a error output

Search pattern not terminated at -e line 1.

Found the script from this blog [url]

View 7 Replies View Related

Programming :: Replace Part Of A File With Another?

Jan 8, 2010

There are a few things I was wondering about (using tools available in bash):How to insert a file at at the specified location of another.How to copy a portion of a file between two lines matching a regex to another file (and/or making sed only work between two lines matching a regex)How would you do this?

View 2 Replies View Related

Programming :: Search And Replace In A Binary File?

Aug 11, 2010

i need to change a binary file, let's say to find and replace username:

find string: "/home/name/bla-bla-bla/ "
new string: "/home/anewname/bla-bla-bla/ "

i can do it, for example, in emacs (hexl-mode), but interesting in writing a script instead. it will be much more better for me if i could do it automatically. is there an analog of: sed 's/string1/string2/g' ? P.S. the best way is to recompile the binary files i have, but there are no sources available.

View 5 Replies View Related

Programming :: Replace 2nd Occurrence Of A String In A File - Sed Or Awk?

Apr 5, 2010

I know how to replace a particular instance (say 3rd one) of a word in a line using sed based on the sed one-liners. However I would like to replace a particular instance of a word in the entire file.

For example, here is a file:

Code:
John
Betty
Jack
Ron
Jack
Paul

So now I would like to replace the second instance of Jack (in red color) with "Rob" (for example). Not quite sure how to do that? I tried couple of things from here but they did not work.

View 10 Replies View Related

Programming :: Replace String In File Using Perl Or Sed

Jun 30, 2011

I have question about replacing a string in a file.

How can I replace the printerb's 10.1.1.1 to something else(10.1.1.2, for example) without replace printera's 10.1.1.1 accidentally?

I have tried perl -e -pi "s/10.1.1.1/10.1.1.2/g" /etc/hosts. but, perl replace both 10.1.1.1 to 10.1.1.2.

View 13 Replies View Related

Programming :: Replace Spaces With Underscores In File Names?

Jan 11, 2011

I often get files with many spaces as part of their names. I would like to automatically replace these spaces with underscores, but otherwise not change the file name. Is there a way to do this task with just the bash shell?

View 4 Replies View Related

Programming :: Replace The Default Path In A File(which Is A Script)?

Jul 19, 2010

I am trying to replace the default path in a file(which is a script)with the new path which I have get when the bash script runsThe code is

SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
sed -i "s/$HomeDir/$SCRIPTPATH/g" <filename>

[code]....

View 4 Replies View Related

Programming :: Sed Doesn't Accept Variables To Replace In File

Mar 17, 2011

[code]...

The variables are clean and available in my script. No prob. $old is an IP-address of a server, $new as well. replacement-file is an xml-file (the ip-address to be changed is within an xml-tag). It should be trivial, but it isn't. I spent the last 3 hours reading about the problem, trying several different 'solutions' or workarounds. It should work, the '"' should take care that the variables get expanded, but whatever I try the old server IP isn't replaced.

View 7 Replies View Related

Programming :: Sed To Read The File And Replace And Insert The Pattern?

Jun 11, 2009

I want to read from the file and check for the pattern, if the line has some word like <string>: then string should be copied into buffer. Afterwards, I want to insert the same <string> with some word in the next line of the file. use sed command to perform the above mentioned operations?

View 2 Replies View Related

Programming :: Shell Script Replace A Line From A File?

Mar 4, 2010

I am beginner in this business of shell script and I have no idea how to do the following: I would like to replace the lines of my file that contains 'CFL=' by 'CFL=0.5'. Note that I want to replace the full line meaning

View 11 Replies View Related

Programming :: Sed Script - Searching For Text Within File / Replace With Variable

Feb 25, 2011

Code:
#!/bin/bash
VARR=`cat /proc/asound/cards | grep HDMI | cut -c 1-2`
VARX="defaults.ctl.card $VARR"
VARY="defaults.pcm.card $VARR"
FILE1="alsa"
FILE2="alsa.new"
echo $VARX
echo $VARY
sed "s/defaults.ctl.card*/'$VARX'/g" $FILE1 > $FILE2

This is what I have right now. Well, I thought I knew sed, and apparently I don't... I tried writing this for someone else, and this has given me trouble, so since the user pretty much figured it out on his own, here it goes.
Say VARR=1, so VARX and VARY contain the above text, appended by 1.
What I am trying to do is replace the text "defaults.ctl.card 0" by VARX and "defaults.pcm.card 0" by VARY. The contents of FILE1 is the file being used to search for both text fields, and FILE2 is the output file. I tried using single quotes, double quotes, and a mixture of both, and no go whatsoever. So my question... What is the proper way of searching for text within a file and replacing with a variable?

View 5 Replies View Related

Programming :: Multi File Recursive Folder Search And Replace?

Aug 3, 2010

I'm wanting to mod some PHP files across a hierarchy and thought I'd drive it with find + grep + xargs

I built up a command line which I was confident would do the job, but now can't save the results.

First I tried this:

Code:
find . -name *.php | xargs grep serialize | cut -d: -f1| sort -u | xargs sed -i s/serialize/serialise/g
but that didn't work:
Code:
sed: illegal option -- i
so I thought I'd try using
Code:

[Code].....

View 10 Replies View Related

Debian Programming :: Replace Certain Text In A File With Person Username Automatically?

Mar 16, 2014

Is there any way to use sed to replace certain text in a file with the persons username automatically? Right now i'm using
Code: Select allsed -i.bak s/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g file.foo

I would like it to automatically inject the persons usrname in the replacement string. Is this possible? I've been looking on line at various sed tutorials and I cant quite find what i'm looking for. I also didn't really see anything in the forums search function.Essentially i'm trying to take this file URL...Android.rules and replace all instances of username with the persons actual username automatically.

Code: Select allsed -i.bak s/username/$USER/g 51_Android.rules

View 0 Replies View Related

Programming :: Rename File Names : Replace Dots By Spaces, Keep The Extension?

Mar 28, 2011

I am trying to rename a lot of files but need to keep the extension :

the files are films names :

a.b.c.d.***.iso

the result should be replacing "." by spaces " "

this command :

for files in *.iso ; do mv "$files" `echo "$files" | tr '.' ' '`; done

put a space also before the extension iso ??

How can I rename files from

"a.b.c.d.iso" to "a b c d.iso"

View 5 Replies View Related

Programming :: Sed One-liner: Search Text In File And Replace It - If Not Present Insert It?

Oct 16, 2010

As indicated in the subject, I want to search a text. If the text is present I want to replace it. But if the text is not present, I want to insert it after first line and before last line.

Searched text is:CleanCache "*";

Where * can be anything.

Example: CleanCache "false"; -> CleanCache "true";

If CleanCache "false"; is not present, only insert CleanCache "true"; after first line and before last line.

View 8 Replies View Related

Programming :: Text File Replace Occurrences Of Three Character String ZZZ With Quotation Mark

Mar 30, 2010

I want to use SED to do the following: In a text file replace any occurrences of the three character string ZZZ with a quotation mark "and. replace all occurrences of a comma with a semi-colon. It is the S/ / / command which is stumping me on the first issue...inparticular how to get the replace string to be quote.

View 9 Replies View Related

Programming :: Write A Utility Which Will Scan In A Text File And Search And Replace Strings?

Jul 16, 2010

Something very handy to do in a Linux shell, is manipulating files and strings - essentially parsing data. Write a utility which will scan in a text file and search and replace strings. We also want to keep track of how many strings we've replaced.

I know that my command would look like this: <utility name> <filename> <stringToSearchFor> <stringToReplaceWith>
Code: #!/bin/bash

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved