without password to login into remote machine- in the script ??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting without password to login into remote machine- in the script ??
# 1  
Old 06-12-2009
without password to login into remote machine- in the script ??

HI,

I need to write a script ..

when I run this script , will directly goto that remote machine without asking password..

Once it is entered, I needs to transfer some of the log files...


how can I proceed ?
# 2  
Old 06-12-2009
If you can ssh to the remote server, then you can use scp or sftp to transfer the log files without password.

For this you need to generate ssh keys from your server, so you can send your key to the account on the remote server and add to authorized_keys file onthe remote server. This will enable you to log on without password or scp / sftp without password
# 3  
Old 06-12-2009
explore expect or with perl using CPAN module Net:SSH
# 4  
Old 06-12-2009
Example Script


#!/usr/local/bin/expect --

set timeout 20

set server "[lindex $argv 0]"
set username "[lindex $argv 1]"
set password "[lindex $argv 2]"
spawn telnet $server
expect "login:"
send "$username\r"
expect "Password:"
send "$password\r"
expect "% "
send "ls\r"
expect "% "
# 5  
Old 06-12-2009
Only problem with using expect / telnet is that your password has to be in a script and its plain on the network..

but if security isnt a worry ( not for me... just bloody security group ) then its fine.. if not, then ssh is the way...
# 6  
Old 06-12-2009
you can use rsh and rcp .

Check the man pages of these two for details
# 7  
Old 06-12-2009
hi

please follow the steps in the link

http://www.ehow.com/how_4750765_rsyn...-password.html

i got success after two days struggle.....the article may be misleading at some times . please read carefully

Last edited by aemunathan; 06-12-2009 at 01:50 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Login to remote machine pass commands and capture all in a file

Dear user/friends, After a long gap of 6 years i am back to this forum to find a solution and i hope i will get a solution or atleast a workaround for the problem:p Following is my task which i am trying for almost 3 days without any success. 1) run this command from my terminal (note i... (7 Replies)
Discussion started by: imas
7 Replies

2. AIX

Cannot login into AIX machine. Forgot Password!

Hi, I cannot login to an AIX machine. The login mechanism was that we had disabled remote "root" logins. We have only one user that can access over SSH and that is "userabc". Probably have forgotten the password or it has expired. Is there a way to recover or login. I have the password... (2 Replies)
Discussion started by: aixromeo
2 Replies

3. Shell Programming and Scripting

How to give user name and password in a single command to login to remote server

Hello All, I'm new to unix and i need the below favour from you. I have list of 50 unix server. I need to login to all the server one by one and with the same user and password. I will declare the user name and password globally in the script. for example : servername- hyperV user name... (4 Replies)
Discussion started by: Hari A
4 Replies

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

5. UNIX for Dummies Questions & Answers

ssh to remote machine with 2nd user and password

Hi all, Really hope someone can help me, i have been trying lots of things and just cant seem to nail it - and for something that seems straight forward.... Anyway, scenario is I need to log onto a second machine (remote server) from main workstation. Once logged in I need to run a batch... (2 Replies)
Discussion started by: Hopper_no1
2 Replies

6. Shell Programming and Scripting

Password change logic for remote machine using shell and expect

Day before yesterday,I got the success creating a shell script using expect tool and now it is running successfully on the server. Now I want to make some changes in paswwordchanger.sh as you can see it can handle only one user i.e dbaguest and not other user.So I am thinking the logic how I can... (0 Replies)
Discussion started by: manish_1678
0 Replies

7. UNIX for Advanced & Expert Users

remote ftp login without password

HI all, I need to post some files on to a clients machine and they said we can ftp without username and password. I do the same as a command line it works ftp <hostname>. but when I do that through a script it asks for user name and pasword. Can any one help me how to do a file ftp. ... (4 Replies)
Discussion started by: umathurumella
4 Replies

8. UNIX for Dummies Questions & Answers

Please help with any free unix machine login password

Hi Can any one help me with unix box user name and password. I tried several free sites which provide free unix login, but there I can't use ksh. Thanks:) (5 Replies)
Discussion started by: itsjoy2u
5 Replies

9. Shell Programming and Scripting

want to do login to remote server with out password

Hi All I am new to Unix. I have write srcipt which will automate the follwing tasks login to F-Secure server over ssh copy file from my local server to that server. Remote server wants to login with out password(ssh-keygen) I am not getting how to write that scirpt Please help me... (0 Replies)
Discussion started by: prithvi0075
0 Replies

10. Shell Programming and Scripting

Login to a remote solaris machine as superuser through perl

I am trying to write a perl script that will do remote machine. I have done user loging using simple command; $telnet->login('test', 'test123'); But now I want to do root login or superuser login. So I tried the superuser command, $telnet->cmd("su"); But I am not able to send the... (0 Replies)
Discussion started by: james2
0 Replies
Login or Register to Ask a Question