Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-21-2020, 12:28 AM
kingzleshe kingzleshe is offline
Registered User
 
Join Date: Feb 2018
Posts: 23
issue about ConnectToHostsInClipboard-One-per-Line-AdHocTabs.py

Base on the script description blow I can successfully connect my host with auth.
But once the password contains "@" the script does not work anymore. for instance
Code:
ssh://user1:p@ssword@192.168.1.1
Is there any way to fix this?

Code:
# $language = "Python"
# $interface = "1.0"

# ConnectToHostsInClipboard-One-per-Line-AdHocTabs.py.txt
#
# Last Modified:
#   08 Jan, 2020
#     - Initial revision
#
# Description:
#   - Shows how to instruct SecureCRT to establish ad hoc
#     connections to hosts listed one by one in the clibboard.
#     For example, if the following is in the clipboard...
#       host.a.domain
#       host.b.domain
#       host.c.domain
#       host.d.domain
#       host.e.domain
#       host.f.domain
#
#     ...Or even, with auth:
#       ssh://user1:p4$$w0rd@192.168.1.1
#       ssh://user2:p4$$w0rd@192.168.1.2
#       ssh://user3:p4$$w0rd@192.168.1.3
#       ssh://user4:p4$$w0rd@192.168.1.4
#       ssh://user5:p4$$w0rd@192.168.1.5
#       ssh://user6:p4$$w0rd@192.168.1.6
#
#     ... then running this script will cause SecureCRT
#     to connect to each host on a specific line in
#     separate tabs in the SecureCRT window.

Last edited by kingzleshe; 04-21-2020 at 12:31 AM. Reason: format
Reply With Quote
  #2  
Old 04-21-2020, 10:53 AM
cboyack cboyack is offline
VanDyke Technical Support
 
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 25
Quote:
Originally Posted by kingzleshe View Post
But once the password contains "@" the script does not work anymore.
Special characters like the "@" symbol will need to be encoded in URL format, because it has special meaning to signify the separator between the username and the host name. Thus, before you copy the lists of user:pwd@host entries to the clipboard, you'll need to specify this character in your password by using the hexadecimal URL encoding for the "@" symbol, which in this case, is "%40".

As an note, if you're using any other special characters in passwords with your user:pwd@host specifications, you will need to perform this same replacement procedure with any of those characters.

Here's a link to a prior forum post that addresses this in a similar fashion for our SecureFX product:
https://forums.vandyke.com/showpost....70&postcount=2
--Cameron
Reply With Quote
  #3  
Old 04-21-2020, 11:24 AM
kingzleshe kingzleshe is offline
Registered User
 
Join Date: Feb 2018
Posts: 23
Quote:
Originally Posted by cboyack View Post
Here's a link to a prior forum post that addresses this in a similar fashion for our SecureFX product:
https://forums.vandyke.com/showpost....70&postcount=2
--Cameron
thanks, it worked out
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:54 PM.