Sponsored Content
Top Forums Shell Programming and Scripting su through normal user prompting for password. Post 302609813 by giridhar276 on Tuesday 20th of March 2012 12:41:47 PM
Old 03-20-2012
su through normal user prompting for password.

I have two users on linux box, say user1 user2.Both the users are having passwords.

Now I would like to run the script from user1 and switch to another user i.e., user2 from the script itself.

** I do have limited access and I am running from the normal user account.Not from the root account.***

Since running from the normal user, it is prompting for password.

Any ideas on this please...
help on the above will be highly appreciated.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH - Prompting for password

Hi, Can anybody tell me a way to do ssh , without prompting for password from keyboard, Using RSA. The requirement is I need to create the key , using passphrase also..... Is there any way to do it in UNIX ? I am doing it from AIX machine , but remote machine is Linux I tried... (8 Replies)
Discussion started by: shihabvk
8 Replies

2. UNIX for Dummies Questions & Answers

sftp prompting for password

I have the problem with SFTP; BELOW IS the entry from my ssh_config file It's prompting me for password all the time when using SFTP. pLEASE help. (1 Reply)
Discussion started by: dsravan
1 Replies

3. Programming

ssh via java prompting for password

Hi, I have set up my remote server for password-less login via ssh. If I run the command on my server - ssh user@remoteserver "ls -l" I get an output, but when I try to do this via java String sCmd = new String{"/usr/bin/ssh", " user@remoteserver", "\"ls -l\""}; Process p =... (3 Replies)
Discussion started by: nrworld
3 Replies

4. UNIX for Advanced & Expert Users

scp without prompting for password

I am trying to copy a file from remote machine using scp. I followed the steps to configure public/private key usage. But still prompting for password when I do ssh. I did the following steps to configure scp without asking password Step 1 : local host > ssh-keygen -t rsa and when prompted... (9 Replies)
Discussion started by: satish@123
9 Replies

5. Shell Programming and Scripting

running a script using su - without prompting password

hi guys, is there any way to run a script using su - without prompting a password? ex: su - $APPSUSERNAME/$APPSUSERPASSWORD stop_apps.sh my purpose here is to run a script with current dbuser. thanks in advance. (3 Replies)
Discussion started by: d3xt3r
3 Replies

6. Shell Programming and Scripting

Prompting for password

Hi, I have SVN installed in my UNIX solaris server. I actually automated the process that downloads code from SVN server to UNIX solaris server in script. When i run the script, its asking for password to download every element. Its really difficult to type password for every element when... (3 Replies)
Discussion started by: gthangav
3 Replies

7. Shell Programming and Scripting

Ssh is prompting for password

Hi, When i am trying to connect to other server using ssh coomand, it is prompting for password. But i want to hardcode it with username so that it should not prompt for password. And i dont want to use "ssh-keygen" method as it is not allowed. Please help me. Regards, Mukta (7 Replies)
Discussion started by: Mukta
7 Replies

8. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

9. UNIX for Dummies Questions & Answers

SFTP without prompting password

Dear unix experts, i have a requirement as below. i need to use SFTP as FTP. ftp -n -v << ENDFTP open test_ftp.server user ftp_user_name ftp_password quit ENDFTP if i use this in a shell script, it's not asking for password. But i want the similar thing achived using... (5 Replies)
Discussion started by: AraR87
5 Replies

10. Shell Programming and Scripting

Crontab - password prompting

// Red Hat Enterprise Linux Server release 6.7 I wanted to pass the password, but when I execute this cron, it stops at Password: prompt. Please advise on how to fix the error. Thank you for tour help in advance. #!/usr/bin/ksh su - pmserver echo "su - pmserver" cd... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
KIBITZ(1)						      General Commands Manual							 KIBITZ(1)

NAME
kibitz - allow two people to interact with one shell SYNOPSIS
kibitz [ kibitz-args ] user [ program program-args... ] kibitz [ kibitz-args ] user@host [ program program-args... ] INTRODUCTION
kibitz allows two (or more) people to interact with one shell (or any arbitrary program). Uses include: o A novice user can ask an expert user for help. Using kibitz, the expert can see what the user is doing, and offer advice or show how to do it right. o By running kibitz and then starting a full-screen editor, people may carry out a conversation, retaining the ability to scroll backwards, save the entire conversation, or even edit it while in progress. o People can team up on games, document editing, or other cooperative tasks where each person has strengths and weaknesses that complement one another. USAGE
To start kibitz, user1 runs kibitz with the argument of the user to kibitz. For example: kibitz user2 kibitz starts a new shell (or another program, if given on the command line), while prompting user2 to run kibitz. If user2 runs kibitz as directed, the keystrokes of both users become the input of the shell. Similarly, both users receive the output from the shell. To terminate kibitz it suffices to terminate the shell itself. For example, if either user types ^D (and the shell accepts this to be EOF), the shell terminates followed by kibitz. Normally, all characters are passed uninterpreted. However, if the escape character (described when kibitz starts) is issued, the user may talk directly to the kibitz interpreter. Any Expect(1) or Tcl(3) commands may be given. Also, job control may be used while in the inter- preter, to, for example, suspend or restart kibitz. Various processes can provide various effects. For example, you can emulate a two-way write(1) session with the command: kibitz user2 sleep 1000000 ARGUMENTS
kibitz takes arguments, these should also be separated by whitespace. The -noproc flag runs kibitz with no process underneath. Characters are passed to the other kibitz. This is particularly useful for con- necting multiple interactive processes together. In this mode, characters are not echoed back to the typist. -noescape disables the escape character. -escape char sets the escape character. The default escape character is ^]. -silent turns off informational messages describing what kibitz is doing to initiate a connection. -tty ttyname defines the tty to which the invitation should be sent. If you start kibitz to user2 on a remote computer, kibitz performs a rlogin to the remote computer with your current username. The flag -proxy username causes rlogin to use username for the remote login (e.g. if your account on the remote computer has a different username). If the -proxy flag is not given, kibitz tries to determine your current username by (in that order) inspecting the environment variables USER and LOGNAME, then by using the commands whoami and logname. The arguments -noescape and -escape can also be given by user2 when prompted to run kibitz. MORE THAN TWO USERS
The current implementation of kibitz explicitly understands only two users, however, it is nonetheless possible to have a three (or more) -way kibitz, by kibitzing another kibitz. For example, the following command runs kibitz with the current user, user2, and user3: % kibitz user2 kibitz user3 Additional users may be added by simply appending more "kibitz user" commands. The xkibitz script is similar to kibitz but supports the ability to add additional users (and drop them) dynamically. CAVEATS
kibitz assumes the 2nd user has the same terminal type and size as the 1st user. If this assumption is incorrect, graphical programs may display oddly. kibitz handles character graphics, but cannot handle bitmapped graphics. Thus, % xterm -e kibitz will work % kibitz xterm will not work However, you can get the effect of the latter command by using xkibitz (see SEE ALSO below). kibitz uses the same permissions as used by rlogin, rsh, etc. Thus, you can only kibitz to users at hosts for which you can rlogin. Similarly, kibitz will prompt for a password on the remote host if rlogin would. If you kibitz to users at remote hosts, kibitz needs to distinguish your prompt from other things that may precede it during login. (Ide- ally, the end of it is preferred but any part should suffice.) If you have an unusual prompt, set the environment variable EXPECT_PROMPT to an egrep(1)-style regular expression. Brackets should be preceded with one backslash in ranges, and three backslashes for literal brackets. The default prompt r.e. is "($|%|#) ". kibitz requires the kibitz program on both hosts. kibitz requires expect(1). By comparison, the xkibitz script uses the X authorization mechanism for inter-host communication so it does not need to login, recognize your prompt, or require kibitz on the remote host. It does however need permission to access the other X servers. BUGS
An early version of Sun's tmpfs had a bug in it that causes kibitz to blow up. If kibitz reports "error flushing ...: Is a directory" ask Sun for patch #100174. If your Expect is not compiled with multiple-process support (i.e., you do not have a working select or poll), you will not be able to run kibitz. ENVIRONMENT
The environment variable SHELL is used to determine the shell to start, if no other program is given on the command line. If the environment variable EXPECT_PROMPT exists, it is taken as a regular expression which matches the end of your login prompt (but does not otherwise occur while logging in). See also CAVEATS above. If the environment variables USER or LOGNAME are defined, they are used to determine the current user name for a kibitz to a remote com- puter. See description of the -proxy option in ARGUMENTS above. SEE ALSO
Tcl(3), libexpect(3), xkibitz(1) "Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. "Kibitz - Connecting Multiple Interactive Programs Together", by Don Libes, Software - Practice & Experience, John Wiley & Sons, West Sus- sex, England, Vol. 23, No. 5, May, 1993. AUTHOR
Don Libes, National Institute of Standards and Technology kibitz is in the public domain. NIST and I would appreciate credit if this program or parts of it are used. 19 October 1994 KIBITZ(1)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy