1

I've come across using a value separated by a colon after the user in a connection string, e.g. sftp user:abc@hostname. Can anyone tell me what it should do?

I haven't been able to figure it out by using it, and googling for it just turns up the use of a colon after the server to specify a path to cd to.

neomanyouth
  • 13
  • 1
  • 3

1 Answers1

0

As in most URL formats, the part after username and colon in SFTP URL is a password.

[sftp://][user[:password]@]host

Though not all SFTP clients do support passwords in the URL.

Notably, the most widespread SFTP client, OpenSSH sftp, does not. The documentation for its destination command-line argument says:

The destination may be specified either as [user@]host[:path] or as a URI in the form sftp://[user@]host[:port][/path].

  • Thanks you for the response Martin. I still have a point of confusion though: I'm using OpenSSH and if I use my password after the colon it just seems to be ignored. Is that the expected behaviour with OpenSSH, or should it produce an error? – neomanyouth Nov 21 '19 at 13:35
  • It should not be ignored (tested with latest OpenSSH) – It should be treated as a part of a username – If I do ssh foo:bar@host I get prompt foo:bar@host's password: – Martin Prikryl Nov 21 '19 at 13:40
  • 1
    Oh of course, that makes sense. Thanks for the help, marked as Answered. – neomanyouth Nov 21 '19 at 16:52