Hi all

I want to login a machine remotely and doing some operation on the remote machine and then exit the remote machine by a unix shell script. I can login these two machines without passward. How can I do that?

For example, my script is on machine1. that script remotely login to machine2 and do some operation on machine2. After doing that it exits machine2 and back to machine1. I had tried with this script from a machine1

#!/bin/bash
clear
ssh -Y  sudipta@machine2.chem.udel.edu <<EOF
echo 'welcome machine2'
EOF

However, it is giving 'Pseudo-terminal will not be allocated because stdin is not a terminal.' this error.

Thanks in advance
Sudipta

Hello,

The appliation yo are looking for is called rsh or remote shell. Try
man rsh
from google or the command prompt for more information.

Stick with ssh. You might want to have the script run your log out script. By default ~/.bash_logout

What here2serve said. Most systems these days disable stuff like rsh because it is insecure. You can run scripts with ssh much like rsh, but it is much more controllable and secure. See the ssh man page for more information.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.