switch as another user without password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting switch as another user without password
# 1  
Old 05-05-2011
switch as another user without password

I want to switch as another user without using password .Is it posiible ? I have one server B and I have logged in as username u1 but I want to login to that same server using username as u2 but I don't want to give the password for u2.
# 2  
Old 05-05-2011
What OS - there ae commands like pfexec, sudo, su that can do that for you
# 3  
Old 05-05-2011
If sudo is installed, you could sudo su - u2. Appropriate config entries in /etc/sudoers would be required of course. These can only be edited by root though.
# 4  
Old 05-05-2011
Some random thoughts....

Do you have to log in as user 'u2'? Can you do what you want with groups?

Can you use owner or group set UID / GID on an executable?
Could you use SUID and sudo on an executable?

If not, another vote for sudo.

What do you want to do as user u2?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Switch from Local user to root user from a shell script?

Hi, I need to switch from local user to root user in a shell script. I need to make it automated so that it doesn't prompt for the root password. I heard the su command will do that work but it prompt for the password. and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies

2. Shell Programming and Scripting

Switch user terminal error

Hello All, Here I am trying to login a Linux machine as admin user from a Solaris box.. & then switch to root user.. Code I use: ssh admin@<IP> << END su - root << A echo "Hello I am logged in as root" exit A exit END But the error I get.. su: must be run from a... (3 Replies)
Discussion started by: ailnilanjan
3 Replies

3. Shell Programming and Scripting

Switch user without password inside shell

I want to switch to another user without password inside shell. I used the below command and it is not working. sudo su - user1 user1 is not in the sudoers file. This incident will be reported. I'm getting the above message. If I want to add user1 into the sudoers file using... (5 Replies)
Discussion started by: Roozo
5 Replies

4. Shell Programming and Scripting

How to switch user using shell script ?

Hi, script1.sh script2.sh script3.sh From above, script1.sh is the main script which is executed from root user, creates installation directory, changing ownership and execution rights etc..etc.. and finally calls scripot2.sh and script3.sh to create the database as well as for post... (1 Reply)
Discussion started by: milink
1 Replies

5. Shell Programming and Scripting

switch user from local user to root in perl

Hi Gurus, I have a script that requires me to switch from local user to root. Anyone who has an idea on this since when i switch user to root it requires me to input root password. It seems that i need to use expect module here, but i don't know how to create the object for this. ... (1 Reply)
Discussion started by: linuxgeek
1 Replies

6. AIX

Switch user(su) two times

Is it possible to switch to root(if allowed) and then with root privileges switch to another user account "ABC"? To further explain the scenario, ABC is an account which has sugroups=su2DEF and root is not part of su2DEF group. but, given that root can switch to any account(correct me if I am... (7 Replies)
Discussion started by: mtwain
7 Replies

7. Shell Programming and Scripting

Switch to different user without expect

Hi, I have to switch to a different user and execute certain commands and then come back to the original user Ex: My id is 'usstage'. I need to switch to 'apstage', souce a script there, execute a function and then get back again to usstage. Please note that I do not have expect installed... (4 Replies)
Discussion started by: sugan
4 Replies

8. UNIX for Dummies Questions & Answers

Expect command to switch user

Hi I have written a script to switch user and do some operations. I used expect command it doesn't work. It switches the user and waits for the Password to be entered manually. Also, i tried to fetch the pasword from passwd file, it didn't work.The script is as below: ... (4 Replies)
Discussion started by: Sapna_Sai
4 Replies

9. UNIX for Advanced & Expert Users

Switch user :NOPASSWD setting

Hi All, I want trigger a script "abhishektest.sh "whenever a mail come to a user say "abhishek" in my unix server. I dont have root permission. So, for doing this i added abhishek : "|/export/abhishek/bin/wr_test.sh in /etc/mail/aliases in wr_test file : i need to put this line, as i... (2 Replies)
Discussion started by: mindtee_abhi
2 Replies

10. Shell Programming and Scripting

Non-interactive user switch to root

Is is possible switch user from a non-root user to root user without entering the password interactively inside a korn shell script which is run by a non-root user? e.g. I have a non-root user called infodba who is in dba group and I want to create a shell script which is executed by infodba... (5 Replies)
Discussion started by: stevefox
5 Replies
Login or Register to Ask a Question