01-22-2009 06:53 PM
hi, im trying to backup my ironport using the below putty (plink) script:
Rem ### Mail Configs for Each to me@mydomain.com
plink 192.168.1.1 -l admin -i private.ppk "mailconfig me@mydomain.com Y”
But getting the following message:
Unable to use key file "private.ppk" (unable to open file)
Can anyone advise what needs to be done exactly on the ironport cli?
01-23-2009 11:55 PM
well... can you logon using the provided user/key combination?
"unable to open file" seems more a Windows error than an Ironport error.
Steven
01-26-2009 01:13 PM
hi and thanks for reply.. ive never done this before, so im not quite sure what the provided key is .. how do i clarify this, or setup a new one.. and how would i test this.. should it also fit into the above syntax somewhere??
cheers.. :)
01-26-2009 09:51 PM
Hi Dave,
On http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html you can find a good description on how to generate your key for ssh authentication and how to use it.
For your purpose there are a few remarks:
1) Since you want the stuff to run unattended I suggest you do not assign a passphrase (may God curse me for this advice) :oops:
2) To connect the key to your Ironport user you should do a manual logon with that user or use an Administrator role user to log on to the command line of your MGA. Type the command "sshconfig" and switch to cluster mode if needed.
If you logon using another user than you are assigning the key for, use the "USER" option to switch to the correct user and after that, use "NEW" to assign the new key to your Ironport user. (Always use the public part of your key pair for storing on the remote system you want to logon to).
Commit your changes and startup a new putty session to test your new configuration. (Keep your current session active, which gives you the possibility to make modifications if something went wrong)
I hope this helps!
Best regards,
Steven
01-27-2009 12:21 AM
great, thanks for your time steve :)
01-30-2009 10:06 AM
Using expect with SSH keys can do this for you as well. This is what I use below.
#!/usr/bin/expect -f
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
#set timeout -1
spawn ssh -p 22 expect@$ipaddr $scriptname $arg1
match_max 100000
expect "*?assword:*"
send -- "$password\r"
# send blank line (\r)
#send -- "\r"
expect eof
Put the above into a expect script and run a daily or weekly cron
/usr/bin/expect /tmp/ironlogin.exp hostip mailconfig emailaddress
01-30-2009 10:06 AM
Using expect with SSH keys can do this for you as well. This is what I use below.
#!/usr/bin/expect -f
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
#set timeout -1
spawn ssh -p 22 expect@$ipaddr $scriptname $arg1
match_max 100000
expect "*?assword:*"
send -- "$password\r"
# send blank line (\r)
#send -- "\r"
expect eof
Put the above into a expect script and run a daily or weekly cron
/usr/bin/expect /tmp/ironlogin.exp hostip mailconfig emailaddress
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide