Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Well, you still have /Unsafe there. Your browser probably cached the original command-line.
BeWog

I'm late!
. 2022-10-14 09:22:37.983 --------------------------------------------------------------------------
. 2022-10-14 09:22:37.983 WinSCP Version 5.21.5 (Compilation 12858 2022-10-06) (OS 10.0.19044 - Windows 10 Enterprise)
. 2022-10-14 09:22:38.007 Configuration: C:\Users\myuser\OneDrive - toto.fr\Documents\WinSCP.ini
. 2022-10-14 09:22:38.008 Log level: Normal
. 2022-10-14 09:22:38.008 Local account: TOTO\myuser
. 2022-10-14 09:22:38.008 Working directory: C:\Windows\system32
. 2022-10-14 09:22:38.008 Process ID: 14532
. 2022-10-14 09:22:38.019 Ancestor processes: explorer, ...
. 2022-10-14 09:22:38.020 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /Unsafe winscp-scp://admtoto@XX.XX.XX.XX/
. 2022-10-14 09:22:38.020 Time zone: Current: GMT+2, Standard: GMT+1 (Paris, Madrid), DST: GMT+2 (Paris, Madrid (heure d’été)), DST Start: 27/03/2022, DST End: 30/10/2022
. 2022-10-14 09:22:38.021 Login time: vendredi 14 octobre 2022 09:22:38
. 2022-10-14 09:22:38.021 --------------------------------------------------------------------------
. 2022-10-14 09:22:38.021 Session name: helen (Ad-Hoc site)
. 2022-10-14 09:22:38.021 Host name: XX.XX.XX.XX (Port: 22)
. 2022-10-14 09:22:38.021 User name: admtoto (Password: No, Key file: Yes, Passphrase: No)
. 2022-10-14 09:22:38.021 Tunnel: No
. 2022-10-14 09:22:38.021 Transfer Protocol: SCP
. 2022-10-14 09:22:38.021 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2022-10-14 09:22:38.021 Disable Nagle: No
. 2022-10-14 09:22:38.021 Proxy: None
. 2022-10-14 09:22:38.021 Send buffer: 262144
. 2022-10-14 09:22:38.021 Compression: No
. 2022-10-14 09:22:38.021 Bypass authentication: No
. 2022-10-14 09:22:38.021 Try agent: Yes; Agent forwarding: No; KI: Yes; GSSAPI: Yes
. 2022-10-14 09:22:38.021 GSSAPI: KEX: No; Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2022-10-14 09:22:38.021 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2022-10-14 09:22:38.021 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2022-10-14 09:22:38.021 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2022-10-14 09:22:38.021 Simple channel: Yes
. 2022-10-14 09:22:38.021 Return code variable: Autodetect; Lookup user groups: Auto
. 2022-10-14 09:22:38.021 Shell: default
. 2022-10-14 09:22:38.021 EOL: LF, UTF: Auto
. 2022-10-14 09:22:38.021 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2022-10-14 09:22:38.021 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2022-10-14 09:22:38.021 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2022-10-14 09:22:38.021 Cache directory changes: Yes, Permanent: Yes
. 2022-10-14 09:22:38.021 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2022-10-14 09:22:38.021 DST mode: Unix;Timezone offset: 0h 0m
. 2022-10-14 09:22:38.021 --------------------------------------------------------------------------
. 2022-10-14 09:22:38.276 Looking up host "XX.XX.XX.XX" for SSH connection
. 2022-10-14 09:22:38.276 Connecting to XX.XX.XX.XX port 22
. 2022-10-14 09:22:38.289 Connected to XX.XX.XX.XX
. 2022-10-14 09:22:38.310 We claim version: SSH-2.0-WinSCP_release_5.21.5
. 2022-10-14 09:22:38.310 Connected to XX.XX.XX.XX
. 2022-10-14 09:22:38.310 Remote version: SSH-2.0-OpenSSH_7.4p1 Debian
. 2022-10-14 09:22:38.310 Using SSH protocol version 2
. 2022-10-14 09:22:38.322 Have a known host key of type ssh-ed25519
. 2022-10-14 09:22:38.382 Doing ECDH key exchange with curve Curve25519 and hash SHA-256
. 2022-10-14 09:22:38.497 Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of them
. 2022-10-14 09:22:38.498 Host key fingerprint is:
. 2022-10-14 09:22:38.498 ssh-ed25519 255 SHA256:ltSx9W44AqfoUaO
. 2022-10-14 09:22:38.510 Host key matches cached key
. 2022-10-14 09:22:38.512 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2022-10-14 09:22:38.512 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2022-10-14 09:22:38.512 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2022-10-14 09:22:38.512 Initialised HMAC-SHA-256 inbound MAC algorithm
. 2022-10-14 09:22:38.523 Reading key file "C:\Users\myuser\.ssh\id_rsa.ppk"
! 2022-10-14 09:22:38.525 Using username "admtoto".
. 2022-10-14 09:22:38.545 Server offered these authentication methods: publickey,password
. 2022-10-14 09:22:38.545 Offered public key
. 2022-10-14 09:22:38.556 Offer of public key accepted
! 2022-10-14 09:22:38.556 Authenticating with public key "imported-openssh-key"
. 2022-10-14 09:22:38.675 Sent public key signature
. 2022-10-14 09:22:38.686 Access granted
. 2022-10-14 09:22:38.687 Opening main session channel
. 2022-10-14 09:22:38.769 Opened main channel
. 2022-10-14 09:22:38.781 Started a shell/command
. 2022-10-14 09:22:38.838 --------------------------------------------------------------------------
. 2022-10-14 09:22:38.838 Using SCP protocol.
. 2022-10-14 09:22:38.841 Doing startup conversation with host.
. 2022-10-14 09:22:38.854 Skipping host startup message (if any).
> 2022-10-14 09:22:38.854 echo "WinSCP: this is end-of-file:0"
< 2022-10-14 09:22:38.854 Linux helen 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
< 2022-10-14 09:22:38.854 The programs included with the Debian GNU/Linux system are free software;
< 2022-10-14 09:22:38.854 the exact distribution terms for each program are described in the
< 2022-10-14 09:22:38.854 individual files in /usr/share/doc/*/copyright.
< 2022-10-14 09:22:38.854 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
< 2022-10-14 09:22:38.854 permitted by applicable law.
< 2022-10-14 09:22:38.866 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:38.866 Detecting variable containing return code of last command.
. 2022-10-14 09:22:38.866 Trying "$status".
> 2022-10-14 09:22:38.866 echo "$status" ; echo "WinSCP: this is end-of-file:0"
< 2022-10-14 09:22:38.877 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:38.877 The response is not numerical exit code
. 2022-10-14 09:22:38.877 Trying "$?".
> 2022-10-14 09:22:38.877 echo "$?" ; echo "WinSCP: this is end-of-file:0"
< 2022-10-14 09:22:38.889 0
< 2022-10-14 09:22:38.889 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:38.889 Return code variable "$?" selected.
> 2022-10-14 09:22:38.889 printenv LANG ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:38.899 fr_FR.UTF-8
< 2022-10-14 09:22:38.900 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:38.900 We will use UTF-8
. 2022-10-14 09:22:38.900 Clearing all aliases.
> 2022-10-14 09:22:38.900 unalias "ls" ; echo "WinSCP: this is end-of-file:$?"
! 2022-10-14 09:22:38.911 -bash: ligne 5 : unalias: ls : non trouvé
< 2022-10-14 09:22:39.089 WinSCP: this is end-of-file:1
. 2022-10-14 09:22:39.089 Clearing national user variables.
> 2022-10-14 09:22:39.089 unset "LANG" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.098 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.099 unset "LANGUAGE" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.109 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.110 unset "LC_CTYPE" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.120 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.121 unset "LC_COLLATE" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.131 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.131 unset "LC_MONETARY" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.142 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.142 unset "LC_NUMERIC" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.153 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.155 unset "LC_TIME" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.166 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.166 unset "LC_MESSAGES" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.177 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.177 unset "LC_ALL" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.187 WinSCP: this is end-of-file:0
> 2022-10-14 09:22:39.187 unset "HUMAN_BLOCKS" ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.200 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:39.200 Looking up groups and users.
> 2022-10-14 09:22:39.200 groups ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.211 sudo cdrom floppy audio dip video plugdev netdev
< 2022-10-14 09:22:39.211 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:39.211 Following groups found:
. 2022-10-14 09:22:39.211   "sudo" [0]
. 2022-10-14 09:22:39.211   "cdrom" [0]
. 2022-10-14 09:22:39.211   "floppy" [0]
. 2022-10-14 09:22:39.211   "audio" [0]
. 2022-10-14 09:22:39.211   "dip" [0]
. 2022-10-14 09:22:39.211   "video" [0]
. 2022-10-14 09:22:39.211   "plugdev" [0]
. 2022-10-14 09:22:39.211   "netdev" [0]
. 2022-10-14 09:22:39.211 Following membership found:
. 2022-10-14 09:22:39.211   "sudo" [0]
. 2022-10-14 09:22:39.211   "cdrom" [0]
. 2022-10-14 09:22:39.211   "floppy" [0]
. 2022-10-14 09:22:39.211   "audio" [0]
. 2022-10-14 09:22:39.211   "dip" [0]
. 2022-10-14 09:22:39.211   "video" [0]
. 2022-10-14 09:22:39.211   "plugdev" [0]
. 2022-10-14 09:22:39.211   "netdev" [0]
. 2022-10-14 09:22:39.211 No users found.
. 2022-10-14 09:22:39.211 Getting current directory name.
> 2022-10-14 09:22:39.211 pwd ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.222 /home/admtoto
< 2022-10-14 09:22:39.222 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:39.338 Listing current directory.
> 2022-10-14 09:22:39.339 ls -la --full-time ; echo "WinSCP: this is end-of-file:$?"
< 2022-10-14 09:22:39.351 total 52
< 2022-10-14 09:22:39.351 drwxr-xr-x 4 admtoto sudo  4096 2022-09-23 15:31:07.673501313 +0200 .
< 2022-10-14 09:22:39.351 drwxr-xr-x 8 root   root  4096 2019-01-28 15:08:26.000000000 +0100 ..
< 2022-10-14 09:22:39.351 -rw------- 1 admtoto sudo    52 2019-01-28 11:47:41.000000000 +0100 .Xauthority
< 2022-10-14 09:22:39.351 drwx------ 3 admtoto sudo  4096 2019-06-21 14:56:40.575542412 +0200 .ansible
< 2022-10-14 09:22:39.351 -rw------- 1 admtoto sudo    15 2022-03-02 17:26:42.722878142 +0100 .bash_history
< 2022-10-14 09:22:39.351 -rw-r--r-- 1 admtoto sudo   220 2019-01-21 13:31:50.000000000 +0100 .bash_logout
< 2022-10-14 09:22:39.351 -rw-r--r-- 1 admtoto sudo  3526 2019-01-21 13:31:50.000000000 +0100 .bashrc
< 2022-10-14 09:22:39.353 WinSCP: this is end-of-file:0
. 2022-10-14 09:22:39.354 Directory listing with --full-time succeed, next time all errors during directory listing will be displayed immediately.
[truncate]
. 2022-10-14 09:22:39.383 Startup conversation with host finished.

Thank for you help.
martin

Please post a log file.
BeWog

So, i tried and it's not working. 😕

sudo su - is not apply.
winscp-scp://user;x-name=my-server;x-publickeyfile=C:\Users\user\.ssh\id_rsa_sys-admin.ppk;x-shell=sudo%2520su%2520-@192.168.1.55/
BeWog

Thanks

Thank for your reply.

(sorry for the delay ! 😊)
martin

So they will have to change their protocol registration to add the /Unsafe switch.
BeWog

Only few persons will use it.

My goal is to get a list of servers and IPs from a database. Each person will generate its own page HTML to get access to the servers.
martin

But who is the intended audience of the page? Do you have control over their computer? Can you change their WinSCP URL registration?
BeWog

I would like to generate a HTML page with a list of servers.
If I click on a hostname server, it will open WinSCP.
BeWog

Generate URL session – Use only Shell: default

Hello,

I would like generate multiple URL to connect to whole servers list.

I saved a session that's working in WinSCP (5.19.6), then I did a right click to generate URL session. But when I use the URL, shell command is not execute.
In my session list, I select sudo su - in shell options.

URL looks like:
winscp-scp://myuser;

x-publickeyfile=C%3A%255CUsers%255Canuser%255C.ssh%255Cid_rsa.ppk;
x-shell=sudo%2520su%2520-@ip-adress/

I enabled session log file in WinSCP and I see "Shell: default"!
I don't know how to find a solution.

Thanks for your help.