08-04-2006
How to pass passwords to bash scripts?
I'm finding the following command very tedious to type in all the time, so I created a one line bash script called mount.bash with the following contents:
mount -t cifs //mark/C\$ -o unc=//mark\\C$,ip=10.1.1.33,user=Administrator,password=$1 /mnt/mark
I don't like the fact that I have to put my password on the command line. What can I do to to prompt for $1 if it is not provided on the command line and echo "*"'s instead of the actual characters being typed?
Thanks,
Siegfried
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Gurus,
Iam new to Unix.
I had a requirement where i should use a file for example
Host.sh or Host.txt
Host = 555.254.45.14
username = aaaa
pwd = SSSSSS123
And this file need to be used in different scripts.
For example i have script1.sh
where i want to use the values of... (6 Replies)
Discussion started by: pssandeep
6 Replies
2. Shell Programming and Scripting
Hi Unix experts....
I am in the process checking user and root password of more than 1000 servers manulay.
I am very pissed of checking these many servers manualy.
Could some one of you help me how can i check the passwords just by runing some scripts..!
Need Help Guys..! :confused: (5 Replies)
Discussion started by: bullz26
5 Replies
3. Shell Programming and Scripting
Hi
Most of the shell scripts I am dealing with have to connect to oracle database . The username password is stored in a environment file which sets the variables for username and password . Set user id do not work on AIX so users who will execute these scripts need to have read or execute... (5 Replies)
Discussion started by: clifford
5 Replies
4. Shell Programming and Scripting
I know that we can call system command to execute shell script in awk.
but it does not return the result of the command executed , but only returns
the value of the command executoin status ( 1/0 --> failure / success).
Could anyone let me know how to solve this problem. (9 Replies)
Discussion started by: rajnikanth.1912
9 Replies
5. Shell Programming and Scripting
Hi,
I have to write a program to compute the checksums of files
./script.sh
I wrote the program using bash and it took me forever since I am a beginner but it works very well.
I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies
6. Shell Programming and Scripting
Hi All ,
I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B.
The runscript_B.sh in calls another script runscript_A on server A itself.
it seend, i need to be connect from Server A to Server B using ssh.
I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies
7. Shell Programming and Scripting
Hello,
I am studying few things on unux and scripting. I need a script to create bulk users in unux. I need some assistance from you for creating 100 or more User IDs using a bash script:
Here's my requirements:
1. I need to create 100 or even more user ids of different naming... (1 Reply)
Discussion started by: Shelldorado
1 Replies
8. Shell Programming and Scripting
Hello, I have two bash scripts like the following:
script 1:
#!/bin/bash
var=WORLD
bash path/to/second/script/script2.bash
script 2:
#!/bin/bash
echo "HELLO $var"
I expected the output to be "HELLO WORLD" but instead, I get "HELLO". I understand that when I envoke another bash... (2 Replies)
Discussion started by: jl487
2 Replies
9. Shell Programming and Scripting
I want to store the passwords in a global file, so that all the users will not use them to login but a process should use it. One way is to keep the passwords in a .ini file and execute the file in the start of the script and use that variable.
But with this, one can echo the variable in the... (15 Replies)
Discussion started by: karumudi7
15 Replies
10. Shell Programming and Scripting
Hello.
A find command return a list of file.
For each fileReplace the content starting with the first "§" (of two) ending with last "ɸ" (of two), regardless of the content ( five lines )
by the following content (exactly) :
§2019_08_23§ #
# ... (8 Replies)
Discussion started by: jcdole
8 Replies
LEARN ABOUT CENTOS
nwclient
NWCLIENT(5) nwclient NWCLIENT(5)
NAME
nwclient - configuration file for NWClient program suite
DESCRIPTION
This manual page describes the rather simple format of the file $HOME/.nwclient, the configuration file for the NWClient program suite.
FILE FORMAT
The file $HOME/.nwclient consists of several lines, each describing a NWClient connection. Lines beginning with # and empty lines are
ignored as comments.
Because you can store passwords in .nwclient, the user programs will only scan .nwclient when only the file owner has access rights to the
file. The file must be have permissions 0600.
To specify a NWClient connection, the name of the file server, the user name to be used and a password is necessary. The server name and
the user name are specified as SERVER/USER, and the password is separated by a blank. The password field can be omitted. In this case the
user programs will ask you for a password. If you specify the password to be just a dash, then no password is used.
The first valid specification has a special meaning: If the user does not name a server on the command line, the first specification is
used as a 'preferred connection'.
An example might be the following:
# The preferred connection, the user is asked
# for a password
FS311/ME
# And a passwordless account on another server
CD-SERV/GUEST -
With these lines in $HOME/.nwclient, calling 'ncpmount /mnt' will mount the the file server FS311 with user name ME on /mnt after asking
the user for a password.
ncpmount -S cd-serv /cd will silently mount the server cd-serv on /cd.
nprint, pqlist and other user programs that require a valid login also look up $HOME/.nwclient to find a file server, a user name and pos-
sibly a password.
Please note that the access permissions of .nwclient MUST be 600, for security reasons.
SEE ALSO
ncpmount(8), ncpumount(8), slist(1), pqlist(1), nprint(1)
nwclient 12/27/1995 NWCLIENT(5)