remote login


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remote login
# 1  
Old 10-14-2005
remote login

Hi

i have recently switched to unix environment,i am trying to make a shell script
which logs on to the remote machines and plays some commands and collects the out put into a file.but i am not able to create any file on remote hosts.see
the sample code .

rsh hostname -l username << ENDTAG
cd /in/service
ls -ltr >> tmp.stats
exit
ENDTAG

all the hosts are connected in LAN .could any body please help me out.
thanks in advance.
# 2  
Old 10-14-2005
Try this:
Code:
rsh/remsh hostname -l username "cd /in/service; ls -ltr > tmp.stats"

This will create a file called tmp.stats in the /in/service directory on the remote system.
# 3  
Old 10-14-2005
thanks for the code, but i have too many commands to run through a shell script it takes the hostname and username as arguments from a file on local machine and procedes to create tmp.stats file on that host.
# 4  
Old 10-14-2005
So why not do this: write all the commands that you want to execute into a script. Then execute the following sequence of commands:
Code:
rcp script_to_execute remote_host:/tmp/script_to_execute
rsh/remsh remote_host -l username /tmp/script_to_execute
rsh/remsh remote_host -l username rm /tmp/script_to_execute

Your redirection and stuff can all go into the script.
# 5  
Old 10-14-2005
Thanks alot blowtorch
i thought of doing it with style of code i have given as sample but that was failed. i have tried your code thats working .
thanq
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

how to login with ssh to remote system with out applying the remote root/usr password

how to login with ssh to remote system with out applying the remote root/user password with rlogin we can ujse .rhosts file but with ssh howits possible plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

2. Programming

Sockets for remote login

Hi, i have written a program that provides the remote login for the system whose IP is specified. the program is working correctly on the same machine but its not working when i try to communicate with the other system. i am attaching both client and server programs. Please help. ... (1 Reply)
Discussion started by: MrUser
1 Replies

3. Linux

How to find remote Linux box login account without login in to that box?

Hi, How to find remote Linux box login account without login in to that box? I don't have login account at my remote Linux box. But I need who are all having login account. How do I findout? Thanks, --Muthu. (3 Replies)
Discussion started by: Muthuselvan
3 Replies

4. AIX

remote login problem

dear all, i have a problem, when i try to login to CDE on AIX remotely using xmanager i get a dead screen. any solution thanks (1 Reply)
Discussion started by: bondoq
1 Replies

5. Shell Programming and Scripting

Remote Login in to another Terminal

hi all , i need the command for remote login in to another terminal, came accross by using "tty" command. please suggest and help me out in this. Regrds Sridhar. (1 Reply)
Discussion started by: Sridhar_dev
1 Replies

6. Linux

Remote login time

hi all, l have CentOS release 5 (Final). I login to own server using telnet. when write user & pass and press enter than 1 more minute wait. After successful login. Why just login time very slow? 2 week ago it's quickly login. What i will do? (2 Replies)
Discussion started by: Tlg13team
2 Replies

7. Shell Programming and Scripting

Remote login through ssh

Hi , I need to login to remotemachines through ssh and move some logfiles to my localmachine. My servername,username and password will be store in the .profile file. can any one please help me in this? This will be a cronjob so Password can't be enter at run time. Thanks in advance Subin (5 Replies)
Discussion started by: subin_bala
5 Replies

8. UNIX for Dummies Questions & Answers

Remote login with VNC

Hi Everyone, Well I am not sure if this right forum. I have install Redhat 5 enterprise. I have everything running. I have configured vncserver. Starts with out errors. I am trying to connect for a XP machine to my RedHat server. I can connect from my XP machine through VNC viewer but I get... (1 Reply)
Discussion started by: Peterh
1 Replies

9. UNIX for Dummies Questions & Answers

Remote Login (Unix)

Is there any way I can disallow remote login on a m/c (3 Replies)
Discussion started by: DPAI
3 Replies
Login or Register to Ask a Question