SCP not auto completing copies

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Vusa

SCP not auto completing copies

Post by Vusa »

Hi Guys,

I have a problem with Mint6(gnome).. When copying over files from my Mint6 laptop to another Linux server that I have logged into before, the scp statements changes and becomes incorrect when pressing the tab key. Please see example below.

Scenario. I want to copy a file called, file.txt to a remote dir called /attachments/ on server 10.0.0.1

scp file.txt 10.0.0.1:/attachments

On Mint5, I would get auto-completion when I press tab before completing the word "attachments", ie

Code: Select all

scp file.txt 10.0.0.1:/atta[tab]    "would become  correct ==>"     scp file.txt 10.0.0.1:/attachments     
This is because I would have logged into that server before with keys.

The problem on Mint6;

Code: Select all

scp file.txt 10.0.0.1:/atta[tab]    " would become ==>"   scp file.txt /attachments/
:|

I dont have an /attachments/ folder locally. So the Mint6 does check remotely, but doesnt keep the full statement.

Obviously when I press [enter], the command fails.

Any ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
miket

Re: SCP not auto completing copies

Post by miket »

Hi,

The correct syntax for scp is as follows :

Code: Select all

scp ./file.txt username@10.0.0.1:/attachments/
The autocompletion wouldn't make a command completion for a folder on another host, it would only autocomplete if there was a directory with the same name in the current directory.

Mike.


Vusa wrote:Hi Guys,

I have a problem with Mint6(gnome).. When copying over files from my Mint6 laptop to another Linux server that I have logged into before, the scp statements changes and becomes incorrect when pressing the tab key. Please see example below.

Scenario. I want to copy a file called, file.txt to a remote dir called /attachments/ on server 10.0.0.1

scp file.txt 10.0.0.1:/attachments

On Mint5, I would get auto-completion when I press tab before completing the word "attachments", ie

Code: Select all

scp file.txt 10.0.0.1:/atta[tab]    "would become  correct ==>"     scp file.txt 10.0.0.1:/attachments     
This is because I would have logged into that server before with keys.

The problem on Mint6;

Code: Select all

scp file.txt 10.0.0.1:/atta[tab]    " would become ==>"   scp file.txt /attachments/
:|

I dont have an /attachments/ folder locally. So the Mint6 does check remotely, but doesnt keep the full statement.

Obviously when I press [enter], the command fails.

Any ideas?
Vusa

Re: SCP not auto completing copies

Post by Vusa »

Hi Mike,

Your solution does NOT work..

On Mint5, I didnt have a problem with this.

On Mint6 I do.

Any ideas?
miket

Re: SCP not auto completing copies

Post by miket »

Hi,

I think the only reason the autocomplete was working was becuase it was already in your history file, the bash shell will not login to another machine
in any way to make autocomplete work.

Type the command out in full yourself once, then the next time you try it use the tab to see if the autocomplete works.

Mike.
Vusa wrote:Hi Mike,

Your solution does NOT work..

On Mint5, I didnt have a problem with this.

On Mint6 I do.

Any ideas?
Vusa

Re: SCP not auto completing copies

Post by Vusa »

Already tried that, It still doesnt work Mike..
emorrp1

Re: SCP not auto completing copies

Post by emorrp1 »

Hi, not an actual solution to your problem, but a workaround: The latest version of mintUpload (2.1.2) in the community repository has scp support. You'd need to create a new file in ~/.linuxmint/mintUpload/services/ with the following contents:

Code: Select all

type=scp
name=My SCP
host=10.0.0.1
user=<YOUR USERNAME>
pass=<YOUR PASSWORD>
path=attachments
Then, you should be able to just right-click the file in your file manager, click Upload, select "My SCP" from the combo box, and click upload. Alternatively you could run

Code: Select all

/usr/lib/linuxmint/mintUpload/mintupload.py file.txt
from the command line.
Locked

Return to “Software & Applications”