Skip to main content
RinoBroer
Explorer III
October 29, 2022
Solved

SFTP configuration backup fails if there is an @ in the username

  • October 29, 2022
  • 11 replies
  • 8221 views

Hi there,

 

SFTP configuration backup fails if there is an @ in the username, Is this configuration not supported?

 

execute backup config sftp <file name> <SFTP server> <username@domain.com> <password>

 

Best answer by gfleming

Suggest you open a TAC case sounds like this is something that will need to be fixed in FortiOS.

11 replies

gfleming
Staff
Staff
October 30, 2022

I'm not sure how you can have an @ in a username. How do you SSH to this server? Use the same user syntax as you would when using SSH. SSH is usually "ssh user@hostname". Hostname is what you put in the <SFTP server> field.

RinoBroer
RinoBroerAuthor
Explorer III
October 30, 2022

Would you check that if an @ in the username is supported? Unfortunately, I do not have SSH access to the server because it is an cloud file service that offers SFTP access.

 

See print screen below:

2022-10-30 09_07_43.png

FileZilla can connect without problems, see log:


Status: Connecting to stack.rinobroer.nl...
Response: fzSftp started, protocol_version=11
Command: open "rinobroer@stack.rinobroer.nl@stack.rinobroer.nl" 22
Status: Using username "rinobroer@stack.rinobroer.nl".
Command: Pass: ***************************
Status: Connected to stack.rinobroer.nl
Status: Retrieving directory listing...
Command: pwd
Response: Current directory is: "/"
Status: Directory listing of "/" successful

 

gfleming
Staff
Staff
October 30, 2022

DOes logging in work if you omit the domain from the user?

RinoBroer
RinoBroerAuthor
Explorer III
October 30, 2022

I cannot log in with a different username on that particular cloud storage. However, I did test a Synology NAS where I can log in with just a username and it does work properly.

gfleming
Staff
Staff
October 30, 2022

So what happens when you try to connect with FileZilla using just rinobroer (without the @stack.rinobroer.nlas) as the username?

RinoBroer
RinoBroerAuthor
Explorer III
October 31, 2022

That obviously doesn't work

Status: Connecting to stack.rinobroer.nl...
Response: fzSftp started, protocol_version=11
Command: open "rinobroer@stack.rinobroer.nl" 22
Status: Using username "rinobroer".
Command: Pass: ***************************
Status: Access denied
Error: Authentication failed.
Error: Critical error: Could not connect to server

gfleming
Staff
Staff
October 31, 2022

Well then. To be honest this is the first time I've seen a domain as part of a user login to SSH.

Can you escape the @ symbol with a \ to make it work?

execute backup config sftp <file name> <SFTP server> username\@domain.com <password> 

 

RinoBroer
RinoBroerAuthor
Explorer III
October 31, 2022

hostname # execute backup config sftp fgt.conf stack.rinobroer.nl username\@stack.rinobroer.nl ********
Please wait...
Connect to sftp server stack.rinobroer.nl ...
Please wait...
Connect to sftp server stack.rinobroer.nl ...
Send config file to sftp server via vdom root failed.
Command fail. Return code -1

RinoBroer
RinoBroerAuthor
Explorer III
November 6, 2022

Yes this is the same error message

gfleming
Staff
gflemingAnswer
Staff
November 6, 2022

Suggest you open a TAC case sounds like this is something that will need to be fixed in FortiOS.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.