$sftp1 = Net::SFTP::Foreign->new($host1, key_path => '/path/to/id_dsa'); $sftp2 = Net::SFTP::Foreign->new($host1, key_path => '/path/to/id_rsa'); ...