I've written a shell script to alter a particular preference file on OS X (10.3.9), which works fine (tested by running the script from the terminal sat in front of the box).
Problem is, I now have to run this script remotely across a number of machines via remote desktop, so where I've used the... (1 Reply)
hi
I have installed a new Linux machine and having another machine having Solaris on it. i want that when i log into my solaris machine using rlogin from Linux machine then no password prompt occurs...
Thanks in advance. (4 Replies)
I need to create an automated script where I have to use sudo to switch to multiple user so the script stops and prompts for password, Is there a way I can provide the password in same command only?
Remember that, I cannot disable the password settings of sudo as I dont have rights. (4 Replies)
I'm making a script that will be a double clickable .command file and I need it to prompt for the users admin password.
So far I have:
if ]; then
sudo -p "Please enter your admin password: " date 2>/dev/null 1>&2
if ; then
echo "You entered an invalid password... (2 Replies)
Hi,
I am tranfering the files from local machine to remote machine using rsync utility but it is prompting password. but i don't want to provide through prompt. how can i give in my shell script.
can anyone suggest me.Thanks in advance
rsync -rvcpogtl -e "ssh $LOCAL_PORT" $SOURCE_DIR... (1 Reply)
I'm using rsync with the "-e ssh" option so of course it asks for a password using a prompt. Is there a way to tell a script to expect a prompt, wait for it, and give a password when it arrives?
There is a way to give rsync a password as part of its options using a file, but it only works with... (2 Replies)
Hey there, I'm trying to do a very simple rsync to back up my computer to an external drive connected via usb every night, but it keeps asking for a password. I tried using the password file flag, but it looks like that is only a daemon. Does anyone have any ideas? This has eaten up a lot of my... (4 Replies)
hi,
i have a requirement where i need to sudo to another user in the shell script.suppose consider user A and B, first user A calls a shell script and then i need to sudo to user B which executes another shell script inside the earlier one.
also this needs to be automated like while sudo'ing to... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data: I am trying to write a shell script that prompts the user for the password which is "lux" once the correct password... (4 Replies)
I have a script that does an SSH into a remote node. It should expect the prompt and send the password.
#!/usr/bin/expect
set user ;
set pass ;
spawn ssh $user@E-Internal
expect {
-re "RSA key fingerprint" {send "yes\r"}
timeout... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies
LEARN ABOUT REDHAT
getpass
GETPASS(3) Linux Programmer's Manual GETPASS(3)NAME
getpass - get a password
SYNOPSIS
#include <unistd.h>
char *getpass( const char * prompt );
DESCRIPTION
This function is obsolete. Do not use it.
The getpass() function opens /dev/tty (the controlling terminal of the process), outputs the string prompt, turns off echoing, reads one
line (the "password"), restores the terminal state and closes /dev/tty again.
RETURN VALUE
The function getpass returns a pointer to a static buffer containing the (first PASS_MAX bytes of) the password without the trailing new-
line, terminated by a NUL. This buffer may be overwritten by a following call. On error, the terminal state is restored, errno is set
appropriately, and NULL is returned.
ERRORS
The function may fail if
ENXIO The process does not have a controlling terminal.
NOTES
For libc4 and libc5, the prompt is not written to /dev/tty but to stderr. Moreover, if /dev/tty cannot be opened, the password is read
from stdin. The static buffer has length 128 so that only the first 127 bytes of the password are returned. While reading the password,
signal generation (SIGINT, SIGQUIT, SIGSTOP, SIGTSTOP) is disabled and the corresponding characters (usually control-C, control-, control-
Z and control-Y) are transmitted as part of the password. Since libc 5.4.19 also line editing is disabled, so that also backspace and the
like will be seen as part of the password.
For glibc2, if /dev/tty cannot be opened, the prompt is written to stderr and the password is read from stdin. There is no limit on the
length of the password. Line editing is not disabled.
According to the SUSv2, the value of PASS_MAX must be defined in <limits.h> in case it is smaller than 8, and can in any case be obtained
using sysconf(_SC_PASS_MAX). However, POSIX.2 withdraws the constants PASS_MAX and _SC_PASS_MAX, and the function getpass (). Libc4 and
libc5 have never supported PASS_MAX or _SC_PASS_MAX. Glibc2 accepts _SC_PASS_MAX and returns BUFSIZ (e.g., 8192).
FILES
/dev/tty
SEE ALSO crypt(3)HISTORY
A getpass function appeared in Version 7 AT&T UNIX.
BUGS
The calling process should zero the password as soon as possible to avoid leaving the cleartext password visible in the process's address
space.
Linux Manpage 2000-12-05 GETPASS(3)