Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External tools password error when use complicate password #1104

Closed
icysplendor opened this issue Sep 19, 2018 · 3 comments

Comments

@icysplendor
Copy link

commented Sep 19, 2018

Expected Behavior

logon system successfully when use external tools

Current Behavior

For example: authenticating with pre-entered password and access denied when use WinSCP as external tools

Possible Solution

Change a password

Steps to Reproduce (for bugs)

  1. setup a external tools like WinSCP or filezilla the argument is like protocol://%Username%:%Password%@%Hostname%:%Port%
  2. Connect server use external tool (the password is complicate like jhlw(okBmewzvWA)

Context

common operation will be brooked when the bug happed

Your Environment

  • Version used: 1.75.7012.16814
  • Operating System and version (e.g. Windows 10 1709 x64): WIN10 * 64
@pedroeloy

This comment has been minimized.

Copy link

commented Sep 26, 2018

It's probably related to special characters on the password, I call the following script to encode the password and launch winscp.


@echo off

REM Pass Parameters: %1=Username %2=Password in double quotes %3=Hostname
set U=%1
set P=%2
set H=%3

REM WinSCP: Characters to replace, including DOS characters like ampersand, pipe, less-than, greater-than and double quotes
set "space=%%20"
set "hash=%%23"
set "percentage=%%25"
set "plus=%%2B"
set "slash=%%2F"
set "at=%%40"
set "colon=%%3A"
set "semicolon=%%3B"
set "ampersand=%%26"
set "pipe=%%7C"
set "less_than=%%3C"
set "greater_than=%%3E"
set "double_quotes=%%22"

setlocal ENABLEDELAYEDEXPANSION
REM Replaces percentage sign first!
set "P=!P:%%=%percentage%%!"
set "P=!P: =%space%!"
set "P=!P:#=%hash%!"
set "P=!P:+=%plus%!"
set "P=!P:/=%slash%!"
set "P=!P:@=%at%!"
set "P=!P::=%colon%!"
set "P=!P:;=%semicolon%!"
set "P=!P:&=%ampersand%!"
set "P=!P:|=%pipe%!"
set "P=!P:<=%less_than%!"
set "P=!P:>=%greater_than%!"
set "P=!P:"=%double_quotes%!"
setlocal DISABLEDELAYEDEXPANSION

REM Start WinSCP but removes 3 characters from start and end of the encoded password corresponding to the double quotes
REM echo start /D "%~dp0..\WinSCP" winscp.exe "sftp://%U%:%P:~3,-3%@%H%/"
start /D "%~dp0..\WinSCP" winscp.exe "sftp://%U%:%P:~3,-3%@%H%/"

@sparerd

This comment has been minimized.

Copy link
Member

commented Sep 30, 2018

@icysplendor This is likely due to shell meta-character escaping. Try using %!Password% (notice the !) to disable this feature.

https://github.com/mRemoteNG/mRemoteNG/wiki/External-Tools#shell-metacharacter-escaping

@Deaton64

This comment has been minimized.

Copy link

commented Oct 12, 2018

The %!Password% works for me, when previously it didn't. Thanks for that 🥇

@sparerd sparerd closed this Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.