su command without password prompt to non-root account


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users su command without password prompt to non-root account
# 8  
Old 01-07-2009
A work around to logging in as the user w/o a password would be to use ssh with key-based authentication (although sudo is the preferred method).

Copy the public key for your user account to the authorized_keys file for prdusr.

Then run 'ssh prduser@localhost' as your user account. This will open an ssh session as the user and bypass the password prompt.
# 9  
Old 01-07-2009
Quote:
Originally Posted by Lazydog
Question here.

Are you 'sudo su prdusr' from another account other then prdusr? If YES this is a huge security risk if you are not using passwords. Not requiring a password when switching to this user means anyone could switch to this user and have the same rights. Big No No in the real world.
sudo is as dangerous as you make it. (sudo passwd, anyone?) Unless his sysadmin's completely crazy he'd have restricted sudo to only allow one or a handful of users to do this.
# 10  
Old 01-10-2009
su command to non-root without password prompt

Thank you autocross.us for the ssh authentication suggestion. I saw that from my google search for this the other day so I will certainly keep that in mind for future.

This is just an old Solaris HP box that will be replaced in the near future and only a handful of programmers like myself are maintaining old sas applications on it.

So at the moment only root and myself can do this.

The original answer to my initial question was to eliminate prdusr password prompt altogether so limiting just myself and root to be able to su prdusr without the password prompt is a very good compromise for now as I switch to prdusr a lot during my work to submit/check jobs and monitor processes on the old box.

We have a sas problem that generate orphaned processes running forever daily.

I wrote a korn script to detect and auto kill these jobs but it only works partially by looking at very high CPU and no updates to saswork directories. But people can run very high cpu sas jobs without sort (updating their saswork directories) so my script is flawed. And now we are back to manual checking and emailing individual first before killing their jobs.
# 11  
Old 01-17-2009
su command to non-root without password prompt

Just want to say, that the ssh authentication route is the probably the better route to go.

I implemented this and it works sometimes only and not always. I don't know what the problem is.

piping the from file into sudo -S kill -9 process-id doesn't work in an alias. I still get password prompts. Implementing that in a batch korn script works sometimes but not always.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Sudo command prompt for a password

in the /etc/sudoer file this line was added: wtolentino ALL=(ORACLE) NOPASSWD: /bin/chmod when i tried to run this command sudo -u oracle /bin/chmod 775 /appshared/applications/lpa/executables/chrpt001.rep it prompts me for a password for example: $ pwd /appshared/applications/lpa... (2 Replies)
Discussion started by: wtolentino
2 Replies

2. Linux

How to make this command work wihtout password prompt?

Hi, I am trying to run this command to connect to each server without being prompted for the password. How can I do this in Linux redhat 7.2: for HOST in $VIPS; do su - Myadminid -c "ssh -o ConnectTimeout=10 $HOST 'date; hostname; pkill -9 -f -u Myadminid xx00 ; ps -ef |grep Myadminid'" ... (7 Replies)
Discussion started by: mrn6430
7 Replies

3. Solaris

Not getting command prompt after entering the login password

Hi All, I am not able to get the command prompt after entering the login password on solaris server Only access is through console. Server type : sun4u sparc SUNW,Netra-T12 bsnl-north-in > ssh 10.147.17.207 jtoin Connecting to 10.147.17.207 as user jtoin Password: Last login: Wed Mar 5... (1 Reply)
Discussion started by: sandeep_kmehra
1 Replies

4. Solaris

Console - root command prompt displayed twice after hitting enter

Dear All, I hope you can help me. I have a pair of E2900's I've inherited. Both running Solaris 9. Both have LOM> consoles. The problem I'm experiencing only occurs when connected to the /dev/console tty. Whenever I hit 'Enter' for a new line, I receive two new lines: - myhost# ... (11 Replies)
Discussion started by: aleith
11 Replies

5. Debian

password less login to root from a user account

hello friends, one user is created named "user1" I login as "user1" . Now when i do "su -" to be root user I have to give password for root . Is there any way through which we can skip giving the password to root. i.e. user1@work:~$ su - Password: xxxxxx work:~$ I don't want that... (1 Reply)
Discussion started by: pradeepreddy
1 Replies

6. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

7. UNIX for Dummies Questions & Answers

Change other account password from root access

Hi, I have forgotten my personal account password but I still have the root access to the box. Please tell me how can I change my other account password by logging as root. Thanks. Rakesh :D (4 Replies)
Discussion started by: rakeshou
4 Replies

8. AIX

Root login does not prompt for password

I've an LPAR set up on a P690. The LPAR ran AIX v5.2. I then did an upgrade (using the migration option) to AIX v5.3. I've now encountered the problem that, at the console, I cannot log in as root (or as anyone else that matter). I get the login prompt, enter "root " and then the shell returns to... (1 Reply)
Discussion started by: morgan_g
1 Replies

9. UNIX for Dummies Questions & Answers

I need it to prompt me for a root password, so I don't have to log as root

Hi folks, I'm trying to install a program, and I want to place some of the executables into /usr/bin so that they can be executed from any folder on the computer. I've been giveng the root password, but told never to log in directly as root. Instead, I can wait for a password prompt. However, I... (2 Replies)
Discussion started by: lunchtime
2 Replies

10. Shell Programming and Scripting

any way to use SU command without prompt for password

Hi, First i want to tell you i am not a administrator and everytime to run a sqlscritpt i have to login as SU in a particular account to connect to sqlplus.. I want to write a script which can make me free by doin this .. since i am having the permission for SU i want to know if i can SUDO... (7 Replies)
Discussion started by: myelvis
7 Replies
Login or Register to Ask a Question