Sponsored Content
Full Discussion: Password hiding in UNIX
Top Forums Shell Programming and Scripting Password hiding in UNIX Post 302841867 by rbatte1 on Thursday 8th of August 2013 05:04:52 AM
Old 08-08-2013
To Scott,

I have dreamed of such a function. Wonderful.


To mohanalakshmi,

Are you wanting to somehow encrypt the password and store it in a file? If so, you need to think of how you are going to mix it up and how you are going to reverse it. Maybe we can help with that, but you jhave to consider how you make the method secure. If someone can read the file and gets the string Krfmase7fjh!kwern and can read you code on how to reverse it, then the can manually follow the process. Even if you convert it to unprintable characters, then they could still use od to get the character codes and work from there.

If your decrypting script does something like this:-
  1. Read access encrypted password from file
  2. Decrypt value and feed to another command in plain text
..... then the above is a problem. If your logic follows more that:-
  1. You store the encrypted password
  2. Another process has to check the user password by encrypting and matching the stored value
... then this may be better, however if you code continues by doing something obvious because the password check is confirmed, then if they can read your code, they can just do the same but exclude the password checking. Consider:-
Code:
read passwd?"What is the password? "
check_password $passwd
if [ $? = 0 ]      # True returned from check_password function for accepted password
then
   vi /data_dir/payroll_file
else
   echo "You are not authorised!"
fi

There is nothing to stop a user reading this and just running vi /data_dir/payroll_file

What are you actually trying to achieve?



Robin
Liverpool/Blackburn
UK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hiding password from ps

I'm calling a program with a command line arguement containing a password. while the process is running anyone on the system can ps -ef and see the password. Is there a way to prevent this from happening. example PROGRAM USERNAME/PASSWD I've also tried PROGRAM `cat passfile` ... (7 Replies)
Discussion started by: sudojo
7 Replies

2. IP Networking

Hiding an IP address

Is there anyone who knows how to hide an IP from being logged by the site you are visiting. I know of some paid companies but I am looking for a different solution. Is there some way in UNIX to mask the ip. Help this is urgent. Datopdog (1 Reply)
Discussion started by: datopdog
1 Replies

3. UNIX for Dummies Questions & Answers

Hiding login/password in process!

Hello, I am trying to figure out away to hide a command from users when performing a ps check. I have a ksh that purges a table in a database. If I perform a >ps -eaf |grep ksh, I get the login id and password. I do not want other users seeing this. Is there a way to hide this. The login... (5 Replies)
Discussion started by: ctcuser
5 Replies

4. UNIX for Advanced & Expert Users

Hiding files in unix/linux

Can Anybody please help me with the command in Unix/Linux which can help me hide the files which is equal to ATTRIB in DOS Not using . , but any commands in unix which will do this if you any script which will do this ,it will be very helpful Its very URGENT Regards Victor (9 Replies)
Discussion started by: victorvvk
9 Replies

5. Shell Programming and Scripting

Hiding password for FTP in a script

Hi, I have a simple script to ftp from unix to a mainframe to get and put files. Currently I have the password setup in a VARS file and dereference the var in my script. Doing it this way allws me to change the password in only one place but it is still viewable for many people. Is there any... (6 Replies)
Discussion started by: Cass3
6 Replies

6. UNIX for Dummies Questions & Answers

Hiding Password

Hello. A bit of a puzzle here: I have a 3rd party executable, which requires the following parameters: parm1 = program_name, parm2=userid/password, parm3=additional flags. We tried passing password as a variable, but you can do grep, and see what the password actually is I found a bit... (2 Replies)
Discussion started by: Kishinevetz
2 Replies

7. UNIX for Dummies Questions & Answers

New Approach Hiding login password from ps -ef

Hello all , I looked up this site for solutions to hide login info from ps -ef | grep like using a seperate file and store the password in that especially for oracle sqlplus scripts. I just got this thought , But dont know how to implement this in UNIX. Is there a way to revoke access from... (17 Replies)
Discussion started by: simonsimon
17 Replies

8. Programming

C++ overriding Vs hiding

class B { public: void fns(void){//base def;} }; class D:public B { public: void fns(void) {//new def;} }; I was thinking the above is overriding but somewhere else i found the above is just hiding.Only virtual functions can be considered as overriding? This is the exact statement ... (1 Reply)
Discussion started by: johnbach
1 Replies

9. Shell Programming and Scripting

Scripting help/advise on hiding/masking username/password

Hi, I currently have a UNIX script with a function that uses a username and password to connect to the database, retrieve some information and then exit. At the moment, am getting the username and password from a hidden plain text file and permission set to -r--------, i.e. read only to who... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. Shell Programming and Scripting

Remote call not hiding password fields

Not sure on the description, but here is a quick rundown. I have 2 servers, we'll call them serverA serverB On serverB, I am calling a script that inside it has the following: ssh srvdsadm@serverB sudo -u dsadm /opt/apps/DataStage/scripts/autoDeploy.sh ${projName} ${subProjVar}... (1 Reply)
Discussion started by: cbo0485
1 Replies
MKPASSWD(8)						      System Manager's Manual						       MKPASSWD(8)

NAME
mkpasswd - generate hashed password table SYNOPSIS
mkpasswd [ -p ] passwdfile DESCRIPTION
Mkpasswd is used to generated the hashed password database used by the password library routines (see getpwent(3)). The file passwdfile must be in password file format (see passwd(5)). Mkpasswd generates database files named ``passwdfile.pag'' and ``passwdfile.dir'' (see ndbm(3)). Data subsequently taken from the database files differ from passwdfile in one respect. Rather than storing the encrypted password in the database, mkpasswd stores the offset of the encrypted password in passwdfile. Mkpasswd exits zero on success, non-zero on failure. The -p option causes mkpasswd to create ``passwdfile.orig'', a password file in the standard Version 7 format. SEE ALSO
chpass(1), passwd(1), getpwent(3), ndbm(3), passwd(5), vipw(8) 4.3 Berkeley Distribution February 22, 1989 MKPASSWD(8)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy