Sponsored Content
Full Discussion: pass the password to SU??
Top Forums UNIX for Dummies Questions & Answers pass the password to SU?? Post 87769 by bikoyski on Thursday 27th of October 2005 12:51:58 PM
Old 10-27-2005
i'm logged in as 'a'.

but there are commands in the script that does a 'sed', 'rm', 'mv' , but 'a' is not the owner of the files. so i need to 'su' to the owner before i can do anything to the files.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP - Pass password auti

ftp -i -n <<HERE open $IPADD user $USRNAME $PASS cd / get $FNAME close quit HERE Hi all the above script i used for ftp. How to modify same for sftp? thanks in advance (10 Replies)
Discussion started by: bullz26
10 Replies

2. Shell Programming and Scripting

pass a password to an application

Hi folks I am new to shellscripting and I try to automate & guify some jobs. Suppose I have a variable the stores a passwd and an application like "gpg" or "zip" to run from withn the script. how do I pass that passwd (the content of the variable) to the application being called? eg. ... (4 Replies)
Discussion started by: latenite
4 Replies

3. Shell Programming and Scripting

Not able to pass Username and Password in telnet session

I have created a shell script to telnet remote machine. Here is the problem I am not able to pass the login username and password to the telnet session. I have searched forum and got few other methods to achieve this. But I need to know what's wrong in the below script. username="root"... (2 Replies)
Discussion started by: uxpassion
2 Replies

4. Shell Programming and Scripting

Pass root password through script

I have several clients (over 120) connected to my server. I want to push some patch to all the client using a script which copies the file from the server to a specific path on the client and then installs it. But for installation of the patch, it needs to be done thorough root login on client.... (7 Replies)
Discussion started by: shahdeo
7 Replies

5. Shell Programming and Scripting

How to pass decrypted password to script

Hi Everybody, I am trying to write a script (ksh) to connect to oracle db via sqlplus. As I do not want the password to be in plain text, I've tried to use java to encrypt and decrypt it but I am not sure how can I pass the decrypted password to the script. Pls advise. Below is what I would... (1 Reply)
Discussion started by: Nick1971
1 Replies

6. Shell Programming and Scripting

How to pass the password as input parameter to scp

Dear all Does anybody know how to pass the password as input parameter to scp or rsync in unix scripts? I have tried echo <password> | scp filename username@<ip address>:/filepath/ . But it does not work. BTW, I dont want to setup ssh trust between servers in this adhoc task. Regards,... (2 Replies)
Discussion started by: eldonlck
2 Replies

7. UNIX for Advanced & Expert Users

How to auto pass password in shell script !

Hi all, I have a simple script to check the CPU, Swap Memory and Hard Disk. But I can auto assign password in the script to automatic run it in crontab. Everytime when I run this script, it require to insert password like the message below : How can I solve this problem ? (2 Replies)
Discussion started by: cafecoc85
2 Replies

8. Shell Programming and Scripting

Pass the password to su in shell script

Hello, I am using below command but this is asking for tty c42dba {/home/oracle}: echo sersnp | su -c ggs standard in must be a tty Best regards, Vishal (4 Replies)
Discussion started by: admin_db
4 Replies

9. Shell Programming and Scripting

How to pass root password with su and command?

Hello, I have list of around 400 devices. I need to restart a service /etc/init.d/psap23.sh in all of them, but it should restart by root only. Those have some other kind of light Linux. There is no sudo package in that and we can't/shouldn't install. Direct root login is not allowed. I login... (5 Replies)
Discussion started by: solaris_1977
5 Replies

10. UNIX for Advanced & Expert Users

How to pass password as a variable for sshpass authentication?

Using below below command i'm able to connect or authenticate server, In below command password contains special characters sshpass -v -p 'ASJBA%hs76)#' ssh -q -o ConnectTimeout=5 hostname But If I pass password as a variable I'm not able to connect or authenticate server, can you please help... (1 Reply)
Discussion started by: sam@sam
1 Replies
PASSWD(1)						    BSD General Commands Manual 						 PASSWD(1)

NAME
passwd -- modify a user's password SYNOPSIS
passwd [user] passwd [-d files | -l] [user] passwd [-d nis | -y] [user] passwd [-d krb5 | -k] [principal] DESCRIPTION
passwd changes the user's password. First, the user is prompted for their current password. If the current password is correctly typed, a new password is requested. The new password must be entered twice to avoid typing errors. The new password should be at least six characters long and not purely alphabetic. Its total length must be less than _PASSWORD_LEN (cur- rently 128 characters). Numbers, upper case letters and meta characters are encouraged. All options may not be available on all systems. -d database This option specifies the password database that should be updated. The following databases are supported: files This specifies that the password change should be applied to the local password file. When changing only the local password, passwd uses pwd_mkdb(8) to update the password databases. nis This specifies that the password change should be applied to the NIS password database. The rpc.yppasswdd(8) daemon should be running on the master NIS server. krb5 This specifies that the user's Kerberos 5 password should be changed. The host must be configured to use Kerberos. See krb5.conf(5). -l This is the equivalent of -d files. -y This is the equivalent of -d nis. -k This is the equivalent of -d krb5. If a password database is not specified, passwd will change the password database as determined by the Pluggable Authentication Module (PAM) library. The type of cipher used to encrypt the password depends on the configuration in passwd.conf(5). It can be different for local and NIS pass- words. FILES
/etc/master.passwd The user database /etc/passwd A Version 7 format password file /etc/passwd.XXXXXX Temporary copy of the password file SEE ALSO
chpass(1), login(1), pwhash(1), passwd(5), passwd.conf(5), pam(8), pwd_mkdb(8), vipw(8) Robert Morris and Ken Thompson, UNIX password security. HISTORY
A passwd command appeared in Version 6 AT&T UNIX. BSD
February 25, 2005 BSD
All times are GMT -4. The time now is 01:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy