Sponsored Content
Top Forums Shell Programming and Scripting Sudo connect to a remote server and execute scripts in remote server Post 302978422 by masubram on Saturday 30th of July 2016 06:28:25 AM
Old 07-30-2016
Hi Venkat,

Thank you very much for the reply, just got few doubts in the prototype you have attached.

1) In the first line, you have mentioned there is "/bin/uname" what is this exactly for and in place of uname do I need to give the username with which I am connecting to remote server?

2) Also there is "> /dev/null 2>&1;" in the script, is it mandatory to have this line in the script as I don't have permission to that path, including it may fail the script and can I specify any other path instead of it?

Please don't mind if the above questions sound silly, as I am a novice to unix, I find them hard to under stand.

Thanks for your help Smilie

Regards.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remote Connect - SCO Open Server

Hello.. Please helppppppp...!!! I am using SCO Open Server version 5.0 at work. I am trying to find a third party software to use on my computer at home which has windows 98 on it to do remote connect to my work. Is there any such software ? I know there is PC ANYWHERE but i don't think it... (2 Replies)
Discussion started by: jackpotp
2 Replies

2. Windows & DOS: Issues & Discussions

Connect to a Remote Sybase Server Through Script.

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (2 Replies)
Discussion started by: Aparna_k82
2 Replies

3. Shell Programming and Scripting

Connect to a Remote Sybase Server Through Script

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (3 Replies)
Discussion started by: Aparna_k82
3 Replies

4. Shell Programming and Scripting

Script to connect to a remote server and execute scripts

Hello All I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the... (5 Replies)
Discussion started by: sgbhat
5 Replies

5. Shell Programming and Scripting

Execute scripts on remote server

Hi All, I need to first of all establish a connection to remote unix server non-interactively with the help of a shell script and then connect to oracle database from that server all with this script of mine. Please suggest the best method which could be used to connect to server for executing... (1 Reply)
Discussion started by: m_kapur83
1 Replies

6. UNIX for Dummies Questions & Answers

How do I connect to a remote X11 server ?

Hi, how do I connect to a remote x server? i tried this: startx -display 192.168.0.1:0 # when I do this, it just connects to my own x server i.e I see my own desktop. and export DISPLAY=192.168.0.1:0.0 # when I do this nothing happens. (it doesn't even try to connect, no activity in... (7 Replies)
Discussion started by: uxfuser
7 Replies

7. Red Hat

unable to connect remote server using ssh

hi all i am unable to connect remote server using ssh but i am able to ping the server ssh service is running. (5 Replies)
Discussion started by: nikhil kasar
5 Replies

8. Shell Programming and Scripting

Problem connect to a different server then do sudo login and finally run some scripts and get result

I have to write a shell script in my current linux server and I have to connect to a different server then do sudo login and finally run some scripts residing in a particular directory and get results back. I am starting to write my shell script as below but after I do ssh login it prompts for... (2 Replies)
Discussion started by: Devesh5683
2 Replies

9. AIX

Command to connect to remote AIX server

Hi All, Im looking for a command that can remotely connect to another AIX machine and execute scripts present in that server(Possible scenarios are a complete a restart of 3 servers in a cluster through a single script execution present in one of the servers). Im relatively new to AIX and... (5 Replies)
Discussion started by: Vishakh
5 Replies

10. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies
SETUID(1)						      General Commands Manual							 SETUID(1)

NAME
setuid - run a command with a different uid. SYNOPSIS
setuid username|uid command [ args ] DESCRIPTION
Setuid changes user id, then executes the specified command. Unlike some versions of su(1), this program doesn't ever ask for a password when executed with effective uid=root. This program doesn't change the environment; it only changes the uid and then uses execvp() to find the command in the path, and execute it. (If the command is a script, execvp() passes the command name to /bin/sh for processing.) For example, setuid some_user $SHELL can be used to start a shell running as another user. Setuid is useful inside scripts that are being run by a setuid-root user -- such as a script invoked with super, so that the script can execute some commands using the uid of the original user, instead of root. This allows unsafe commands (such as editors and pagers) to be used in a non-root mode inside a super script. For example, an operator with permission to modify a certain protected_file could use a super command that simply does: cp protected_file temp_file setuid $ORIG_USER ${EDITOR:-/bin/vi} temp_file cp temp_file protected_file (Note: don't use this example directly. If the temp_file can somehow be replaced by another user, as might be the case if it's kept in a temporary directory, there will be a race condition in the time between editing the temporary file and copying it back to the protected file.) AUTHOR
Will Deich local SETUID(1)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy