Storing a password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Storing a password
# 1  
Old 06-09-2010
Storing a password

Hello,

for an automated telnet login script I need to store a password on the server. Is there a possibility to store the password in an encrypted form and decrypt it every time the login is performed? Are there any ideas

Love, Sally
# 2  
Old 06-09-2010
It is strongly recommended, if possible in your case, to use ssh instead of telnet. telnet does no encryption at all. ssh also uses a public and private key pair for authentication purposes. So you will not have store a password in a plain file which might be easy to read for others.

There are plenty of threads setting up passwordless ssh/scp connections in this forum (there is a search function) as well are plenty of guides on the internet you can easy find with using your favourite search engine.

If possible do not use telnet - use ssh. Else you might want to use something like expect to control telnet or rsh which is also not encrypted.
# 3  
Old 06-09-2010
I know that passwordless login using ssh is possible.

As ssh is only availible on routers with a crypto-image but not on switches the only way to connect is telnet. I don't want to encrypt the connection, but just the locally stored password used in the script.

I use expect for login to the devices.

Love, Sally
# 4  
Old 06-09-2010
I do not know of any simple solution for that - as the password can be sniffed easily maybe setting correct permissions on the plain file and hiding it somewhere in the filesystem should be sufficient.
There are commands like md5 etc. that can store a password as a hash but I do not know of a simple way to decrypt it. Else it might make no big sense, since everyone who has access to that tool and the crypted file could do that, which reduces it again to having correct permissions on the file and directory.
# 5  
Old 06-09-2010
so storing the file with chmod 600 is may be safe enough?
# 6  
Old 06-09-2010
What is safe enough depends on your needs. Safe is a encrypted connection with keys which seems not possible from what you say. Everything below that is unsafe just in different shades and grades.

chown the file to your user and chmod it to 400. That's not much but better than nothing. Also set appropriate permissions to the directory it resides in.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. Web Development

Storing Passwords

Yes, it's that minefield again. I'm building an AJAX database interface which uses maria/mysql logins instead of keeping a bunch of its own private logins, to try and keep it simple. The thorny bit is, of course, the passwords. Doing this requires it to remember passwords between sessions, not... (4 Replies)
Discussion started by: Corona688
4 Replies

3. UNIX for Dummies Questions & Answers

password protect a CSV file: better solution than ZIP password?

Hi We send *.csv with sensitive data to our customers. Our customers open those files with Excel. A new requirement is that we password protect those CSV files. I thought to pack them with ZIP and assign a password to the archive. But Solaris 10 can't encrypt ZIP files. $ zip -P... (12 Replies)
Discussion started by: slashdotweenie
12 Replies

4. Shell Programming and Scripting

rsync - storing password in script

Hello, I wish to store the password in an rsync script so that when prompted it just enters the password. I know I can set up passwordless logins, but I have never been able to do this on this particular server so I am resorting to storing the password in the script: rsync -avz -e ssh... (4 Replies)
Discussion started by: stuaz
4 Replies

5. Shell Programming and Scripting

About storing the value of wc -l into a variable and then using this value in while

Hi all, I m new to this forum. I ma facing onei issue. I have something like this: length= wc -l < b2| awk '{print $1}' where b2 is filename having detauls like: cat b2 abc1 abc4 xyc3 sbdghf4 but when I do echo "$length" it displays nothing Also I am using awk to overcome... (4 Replies)
Discussion started by: student2009
4 Replies

6. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

7. Shell Programming and Scripting

Storing value in a variable

Hi Everyone, I have a code which requires to be stored in different variables and I am achiving it like this. HOST=`echo $RMP | cut -f2 -d:` NAME=`echo $RMP | cut -f3 -d:` DIR=`echo $RMP | cut -f4 -d:` TYPE=`echo $RMP | cut -f5 -d:` Is there any other way of storing value... (2 Replies)
Discussion started by: gehlnar
2 Replies

8. UNIX for Dummies Questions & Answers

Storing a Function

Hi, I am running Sco Unix v3.2B. I want to know how can I store a function I create so I can use it later simply by just calling it from the command prompt. Sorry if I am asking such a noob question. Thanks. (7 Replies)
Discussion started by: sdilucca
7 Replies

9. Shell Programming and Scripting

Help Storing PID

I have to write a csh script to achieve the following: Run a command and store its PID as a two char variable then issue the ps command. If the ps command is successful output a string if it fails output a separate string and include an if statement and use the test command. Help would be greatly... (1 Reply)
Discussion started by: Porthos
1 Replies

10. Shell Programming and Scripting

Storing a variable?

I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time... (4 Replies)
Discussion started by: hoover90
4 Replies
Login or Register to Ask a Question