Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. scfc1976

    SSH as root but execute command as another user.

    Trojan. It was considered, however during initial trials "bob's" variables were not passed to workstationA and the script wouldn't run. We kept getting an exit value of 1 : (syntax or usage error). I should have mentioned that in my first post. Thanks for the thought though. scfc
  2. scfc1976

    SSH as root but execute command as another user.

    Further to my last post I have an updated version which works well and every time. The last one seemed tempremental. Anyway here goes:- ssh -C workstationA 'su - bob -c "/path/to/script"' Hope it helps someone else!!
  3. scfc1976

    SSH as root but execute command as another user.

    The only difference that I can tell is the positioning of the quotation marks. We both previously had placed the quotes prior to the su command. eg ssh -n workstationA "su - bob -c /path/to/script" The one I have now is:- ssh -n workstationA su - bob -c "/path/to/script" A subtle difference...
  4. scfc1976

    SSH as root but execute command as another user.

    I managed to find an old scripts hidden in our archive and found the following:- su - bob -c "/path/to/script" That has done the trick. Thanks to both of you for your input.
  5. scfc1976

    SSH as root but execute command as another user.

    PHV. I had tried that but was not getting bobs variables to run the commands. Thanks anyway.
  6. scfc1976

    SSH as root but execute command as another user.

    I probably to the syntax too literally. However further study has found that bob didn't become the user to run the script and the ownership of the output belongs to root. I may try to add a script on workstationA that will su - bob and then run the script from within that script. It probably...
  7. scfc1976

    SSH as root but execute command as another user.

    Tried that but had error: unexpected end of file. However tried a variation on it and got the result I was after. ssh -n workstationA "su - bob; /path/to/script" Thanks for the help. scfc1976
  8. scfc1976

    SSH as root but execute command as another user.

    I am trying to automate a process of copying files from a CD over a network from a host to a remote terminal. Due to the security setup we have I need to SSH as root. However the commands to run a script need the environment of a different user in order to run correctly. I have tried the...
  9. scfc1976

    Changing filenames from upper to lower case.

    Thanks for the response. I kept getting syntax errors, (probably due to seat to keyboard interface), however I mangaed to sort the problem after a bit of a lay off. My code was:- #! /bin/sh cd /home for file in * do if [ -f $file ] then ucfile=`echo $file | tr '[:upper:]'...
  10. scfc1976

    Changing filenames from upper to lower case.

    Hi all, I have been looking at various threads in relation to this and haven't been able to get the right result. The closest I have got was to turn all uppercase characters within a file to lowercase. What I need is to change the filename of various files (the amount of which can change at...
  11. scfc1976

    AWK command with IF statement.

    Annihilannic. It does the job perfectly. I would have spent hours / days on that. Thank you. scfc1976
  12. scfc1976

    AWK command with IF statement.

    Hi all. As a new user of AWK and a inexperienced programmer I could use a bit of help with a little problem. I have a file that could change depending on what users are acessing the file. This file is then used to update information on a database. File example: "Text","data","word","word1"...

Part and Inventory Search

Back
Top