In Linux, best practices dictates I login to a server using my administration credentials, then SUDO SU to the user I want want to use on that server.
I would like to have the option when starting SFTP to pick my username rather than using the default which is already defined for that server.
This way, I do not need to define an SFTP server connection for every server I have.
there's a custom command you can specify in the Advanced settings:
Is this what you are looking for?
No. Specifically what I am talking about is performing a right click on a server name and select Connection with Options > Connect using SFTP. (See attachment).
My request would be to allow an option to connect as a different user.
not sure I completely understand. Doesn't checking the "Prompt for Credentials" option allow you to connect using a different user?
No. That feature is not working for me.
Can you help me understand why it is not working? This checkbox should bring up a credential picker where you can use an alternative username/password. Maybe I'm missing something?
I did click on "Prompt for Credentials" and a red square appears, then I click "Connect using SFTP" and it just logs in as the specified user.
Unfortunately your screenshot doesn't really show which kind of connection you right-clicked. I'm assuming it's not a File Transfer connection, right? If you right-click a terminal connection, the Connect using SFTP will not honor the prompt for credentials option because those options belong to the terminal connection. The "shortcut command" Connect using SFTP just takes the terminal connection settings and creates an ad hoc connection based on that terminal connection.
If you create a File Transfer connection to the same host as the terminal connection, you can right click the File Transfer connection and use the prompt for credentials options there.
I hope this clears things up. Let me know fi this helps.
You are correct. This is a terminal connection. I have about 75+ terminal connections configured. It would be beneficial to have the ability to right click on the existing server and select connect using SFTP and then be prompted for credentials.
Please add this to the wish list so I do not need to double my terminal connection count.
A potential workaround would be to remove the auto login from the terminal connection, but this not ideal either.
You could use a File Transfer template instead which prompts for credentials. Simple create a new File Transfer template and set the computer name / URI to $URI$. Setup everything else as you like. For the credentials part in the template you can set the credential mode to "Credential by name" and put a "?" (without the quotes) in it. This will invoke the credential prompt.
Then you can right-click on your terminal connection and use "Connect using Template", select your template.
If you only have a handful usernames to choose from you could create a template for each username, set the credentials in the template and directly choose the template then.
Let me know if this helps.