Thursday, March 3

Using ssh on *nix

1. Executing sql script on remote host 
serv1> cat local.sql | ssh oracle@serv2 '. ~/.profile; cat|sqlplus -s / ' 2>/dev/null

2. Generating ssh kesy
serv1> ssh-keygen -t dsa 
# the public and private keys will be created in the ~/.ssh  directory

3. Configuring autologin (ssh) to the remote server
serv1> cd ~/.ssh ; cat id_dsa.pub | ssh oracle@serv2 'cat >> ~/.ssh/authorized_keys'
#This is enable you to ssh (login) to remote server without the passwords.

0 comments:

Post a Comment