execute a command in remote


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers execute a command in remote
# 1  
Old 08-04-2006
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)
# 2  
Old 08-04-2006
Given an IP address, username, and password, you can use ssh to login to other machines, i.e.
Code:
ssh username@hostname command

It will ask you for the password every time.
# 3  
Old 08-08-2006
What if you wanted to access your a computer over the internet, but it was on a lan too (it's ip is spit up by a router).... username@ip_address wouldn't work would it?
# 4  
Old 08-08-2006
'ssh username@ipaddress' should still work, if you're actually ON that lan branch. If it's across the internet behind a NAT firewall, it won't, not unless you arrange for that router to forward port 23 to your computer.

Last edited by Corona688; 08-08-2006 at 11:27 AM..
 
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

Execute command on remote host via ssh

How should i make the following code working #!/bin/bash INPUTFILE="test.txt" while read STRING; do IP=`host -t A $STRING | awk '{print $NF}'` HOSTNAME=`ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no $IP "hostname"` echo $HOSTNAME > out.txt done < $INPUTFILE At this moment while... (3 Replies)
Discussion started by: urello
3 Replies

3. Shell Programming and Scripting

How to execute command in remote server without entering password?

Hi, i want to run the command in remote server through ssh and every time when i run the script its asking to enter the password. I dnt want to enter the password, when i enter the ip address and directly the command shuld execute. Script: #!/bin/bash echo "Enter Server IP Address:" read... (2 Replies)
Discussion started by: bapu1981
2 Replies

4. Shell Programming and Scripting

SSH execute remote command (with jump)

Hi all, I am facing the following issue: Host A should execute a remote command (say pwd) on host B2. B2 is not directly reacheable but you have to connect from a to B1, then from B1 you can execute the command ssh user@B2 pwd. B1 and B2 are directly connected: A => B1 => B2 | ... (3 Replies)
Discussion started by: Evan
3 Replies

5. Shell Programming and Scripting

ssh to remote host and execute command

Hi, could anyone please tell me how to ssh to remote host foo and execute command on it and print the result on local host? Thanks, Paresh (1 Reply)
Discussion started by: masaniparesh
1 Replies

6. HP-UX

How to execute a remote file with local command

Hello, I know this is somewhat strange, but please let me know if possible. I want to execute a program file in the remote machine with command on the local machine. Let me make things more clear. Suppose I have a cc on my local system and do not have that on the remote system. I want to use... (2 Replies)
Discussion started by: Veera_Raghav
2 Replies

7. Shell Programming and Scripting

How to execute remote ssh command - Perl and CGI

Hi, I am having nightmare issue-ing remote ssh command from a CGI perl script. It just won't run on debug message: It says permission denied. Can I even do this? as the apache server running under DAEMON account probably can't execute it? Is this the case of what's going on? Here is my... (3 Replies)
Discussion started by: Dabheeruz
3 Replies

8. 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

9. Shell Programming and Scripting

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... (0 Replies)
Discussion started by: Ranu
0 Replies

10. Shell Programming and Scripting

Question about how to execute command on the Sorias from the remote.

Hi, all please help me this time@@! I want to execute the shell on the server from the remote. How can I do that and save the return code in the variable? I want to execute the script on the ten servers at the same time... I'd like to find a fast method to solve it! Thanks in advance! (3 Replies)
Discussion started by: GCTEII
3 Replies
Login or Register to Ask a Question