Problems with Alias, /bin/sh and sudo


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problems with Alias, /bin/sh and sudo
# 1  
Old 05-29-2008
Problems with Alias, /bin/sh and sudo

'exec /bin/sh' breaks alias

--------------------------------------------------------------------------------

I have an application that requires su to root in order to run some commands. Unfortunately, my corporate policy only allows sudo so I created an alias in .profile as "alias su="su myaccount". My external application logs in with the first account no problem, it then runs 'exec /bin/sh' and then tries to su with the myaccount password but it comes back with 'incorrect password'. If I use an ssh account, login with my first account and then su with myaccount password it works fine. It looks like the 'exec /bin/sh' does not take the alias. /bin/sh points to bash. I have the alias in .bashrc, .profile, .shrc and .bash_profile but none of this works.

any ideas on how to get the alias to work with the /bin/sh shell?

Thanks

Stu
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Redistribution bin required for AIX. j7r164redist.7.1.0.25.bin

Hi, I am planning to install a version of Informatica on my AIX box. It requires a specific java build in pap6470_27sr2-20141101_01(SR2). The current link for IBM 64-bit SDK for AIX®, JavaTM Technology Edition, Version 7 Release 1 has a more recent version in j7r164redist.7.1.0.75.bin. Is... (4 Replies)
Discussion started by: meetpraveens
4 Replies

2. UNIX for Dummies Questions & Answers

SUDO help with command alias

Hi there, I'm trying to setup sudo privileges for a user, Oracle in this case, to run Unix commands like mv,chmod, chown, mkdir, rmdir against their own set of commands or scripts. Is there an easier way to do this than to give Unix commands for each of their respective commands as shown below... (2 Replies)
Discussion started by: mbak
2 Replies

3. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

4. Cybersecurity

sudo /bin/sh or sudo su -

we are looking at changing the way we get root on our network. in our current system if an admin needs root access he just gets the root password and uses an su. some of our staff have decided that a sudo to "/bin/sh" will be easer. some of our staff think a sudo to "su -" will be better. I... (0 Replies)
Discussion started by: robsonde
0 Replies

5. UNIX for Dummies Questions & Answers

Alias /usr/bin to /bin in profile

Hi! All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies

6. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

7. Shell Programming and Scripting

'exec /bin/sh' breaks alias

I have an application that requires su to root in order to run some commands. Unfortunately, my corporate policy only allows sudo so I created an alias in .profile as "alias su="su myaccount". My external application logs in with the first account no problem, it then runs 'exec /bin/sh' and then... (1 Reply)
Discussion started by: stulincoln
1 Replies

8. Shell Programming and Scripting

sudo problems

I am trying to execute a command via sudo through ssh... something like this... ssh -t a@b "sudo command" getting an error saying sudo: command not found what could be the prb? (3 Replies)
Discussion started by: wannalearn
3 Replies

9. UNIX for Advanced & Expert Users

alias and sudo

I'm using personal user to enter telnet session then manually connecting to a generic user using the following : sudo -H -u $1 ksh -c ". ~$1/.profile && cd ~$1 && ksh" ; where $1 is the generic user. It works but in the ".profile" execution , the alias are not working when the generic... (7 Replies)
Discussion started by: Nicol
7 Replies

10. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies
Login or Register to Ask a Question
DEBPKG(1)                                                     General Commands Manual                                                    DEBPKG(1)

NAME
debpkg - wrapper for dpkg SYNOPSIS
debpkg dpkg-options DESCRIPTION
debpkg simply invokes dpkg(1) but first becomes superuser so that dpkg is able to install and remove packages. It also cleans the environ- ment and resets PATH to a sane default: "/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11" so that local versions of programs are not run by accident. REQUIREMENTS
debpkg must be given superuser privileges in some way to function properly. Access to debpkg with those privileges is the same as having superuser access to your machine. debpkg will abort if it finds that it neither being run by root nor setuid root. The devscripts package has been designed to allow debpkg to be made setuid root. This works by using a compiled wrapper script, which means that suidperl is not required. See dpkg-statoverride(8) if you wish to make this program setuid root. sudo or super could also con- ceivably be used. AUTHOR
Christoph Lameter <clameter@debian.org>; minor modifications made by Julian Gilbey <jdg@debian.org>. DEBIAN Debian Utilities DEBPKG(1)