Execute command from terminal on remote machine


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execute command from terminal on remote machine
# 1  
Old 10-09-2007
Execute command from terminal on remote machine

Hi All,

I want to execute some commands on unix machine from the mac machne. I have two options for doing so, I am confused which is the best way of doing. Here are two options.

Requirement:
Execute command on the remote server machine. Commands to be executed itself contain arguments to be passed to some script.

Option1:
1. Perl script to do ssh and expect to connect to the remote machine and execute command over there.
Complexity/Overhead: If I need to execute any new command, I have to overwrite '.exp' file.

2. Use Net::SSH:Expect perl module to do so.
Complexity/Overhead: Bit difficult to install perl module on mac os. Smilie

I am confused here which is the best option which suite my requirement.

Will appreciate any guidance.

Thanks,
Ranu
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

2. Shell Programming and Scripting

How can I execute local script on remote machine and include arguments?

I have a script in local server cd /home/dell/work/BOP/testdir ./processchk po (here processchk is a script & po is passed as an argument) Now I want to execute this script from remote server ssh $username@$hostname "cd /home/dell/work/BOP/testdir; ./processchk po" But Its getting error... (9 Replies)
Discussion started by: manohar2013
9 Replies

3. Shell Programming and Scripting

Execute shell script on remote machine

I want to execute a shell script(set of commands) on remote machine and that script takes input from text file(local machine). Please refer below: ssh user@hostname 'bash -s'< ./test.sh file.txt But i got the error file.txt doesn't exist. Can anyone help me on this. Content of test.sh: ... (2 Replies)
Discussion started by: manishtri88
2 Replies

4. UNIX for Dummies Questions & Answers

Execute shell script in remote machine

Hi All, We have 2 servers A and B. B is having a sctipt called b.sh in path /home/dev/scripts. Now my requirement is i want to execute b.sh from server A. Kindly help me. (3 Replies)
Discussion started by: Girish19
3 Replies

5. IP Networking

Execute script located on a remote machine

So, is there way of automating this ? My ultimate goal is to run some cmd script in windows and it should connect to a remote unix host and run a script x.sh located on the remote unix host. I was wanting to achieve this by using WinSCP and Putty only. If possible let me know how and if not... (25 Replies)
Discussion started by: mohtashims
25 Replies

6. Shell Programming and Scripting

Change user on remote machine and execute script!

Hi, I need to login into remote server and execute a shell script over there. As of now i am making use of ssh command ssh primUser@135.254.242.2 sh /poll.sh I am logging in as primUser but unless i change the user to root the script execution on the remote machine is not possible. ... (5 Replies)
Discussion started by: goutham4u
5 Replies

7. SCO

Execute command in remote

Hi, How to execute unix commands in remote unix servers? Thanks, Pintu (2 Replies)
Discussion started by: pintupatro
2 Replies

8. Shell Programming and Scripting

how to execute a script on remote machine

hi unix guru's i am new to unix shell programming. i found a trouble in executing a script(bali.ksh) which is available on serverA with username xyza, this script contains sqlplus command to retrive the data from the database available on other serverC. Now i need to run the above script... (4 Replies)
Discussion started by: balireddy_77
4 Replies

9. UNIX for Dummies Questions & Answers

execute a command in remote

how exec a command (ex. a cut or grep ) in anoter pc i have IP address, login and password. (another account of unix system) what's the sintax of command ??? es. my ip is 192.xx.xx.xx i make a exec of "ls" redirect in outpu file (> "file) in another pc ( ip 192.44.55.2xxx) (3 Replies)
Discussion started by: ZINGARO
3 Replies

10. UNIX for Dummies Questions & Answers

Plz Help : How to use write command to execute command on some other terminal

Hi Group , I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages. - i m writing >write user-id ! ls o ctrl-d inspite of executing the command ls,other terminal shows ! ls. Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies
Login or Register to Ask a Question
uuxqt(1)						      General Commands Manual							  uuxqt(1)

NAME
uuxqt - Executes remote command requests SYNOPSIS
uuxqt [-ssystem] [-xdebug_level] The uuxqt program executes specified commands on designated remote systems. OPTIONS
Specifies the name of the remote system. Use this option only when starting uuxqt manually. The remote system name is supplied internally when uuxqt is started automatically. Displays debugging information on the screen of the local system; debug_level is a single digit between 0 and 9. The higher the number specified, the more detailed the debugging information displayed. DESCRIPTION
When uux is entered by a user, the program creates the necessary C.* (Command), D.* (Data), and X.* (Execute) files and places them in the spooling directory on the designated remote system. The uux command then calls the uucico daemon which in turn, tries to contact the designated system to deliver the files. When the files are transferred, uuxqt executes the commands on the designated system. The uuxqt program searches the spool directories on the designated system for the X.* (Execute) files whose names indicate that they were sent from another system. The command checks each X.* file for the following: All of the required D.* (Data) files must be available and accessible. File commands must be permitted for the requesting system. The uuxqt program can be executed manually by a user with superuser privileges. This daemon is executed automatically by the uudemon.hour shell script, which is started periodically by cron. FILES
Lock file which prevents multiple use of device Limits number of remote command executions Access permission codes SEE ALSO
Commands: uucico(8), uucp(1), uustat(1), uux(1) uuxqt(1)