3

I am login into android phone as usual, but facing problem as below: Try 1: (failed)

$ sshfs -p 8022 u0_a402@192.168.43.189:/storage ~/sshfs-mount2 -o IdentityFile=~/.ssh/termux-rsa  
sshfs: invalid argument `u0_a402@192.168.43.189:/storage'

Try 2: (failed)

$ sshfs -p 8022 u0_a402@192.168.43.189 ~/sshfs-mount -o IdentityFile=~/.ssh/termux-rsa 
sshfs: invalid argument `u0_a402@192.168.43.189'

Try 3: (failed)

$ sshfs -p 8022 192.168.43.189 ~/sshfs-mount -o IdentityFile=~/.ssh/termux-rsa   
sshfs: invalid argument `192.168.43.189'

Try4: (ssh success)

ssh -p 8022 192.168.43.189 -o IdentityFile=~/.ssh/termux-rsa

Welcome to Termux!

Docs: https://termux.dev/docs Donate: https://termux.dev/donate Community: https://termux.dev/community .....

What's the problem with sshfs login ? I want to mount my phone on a folder on manjaro laptop. This sshfs used to work, but somehow when i used phone hotspot to connect, it have this problem.

Kusalananda
  • 333,661
  • It seems to be correct the syntax. Maybe you have and alias. What is the output of type -a sshfs? – Edgar Magallon Dec 24 '22 at 19:25
  • $ type -a sshfs sshfs is an alias for sshfs -p 8022 u0_a402@192.168.43.1:/ ~/sshfs-mount -o IdentityFile=~/.ssh/termux-rsa – andrew_ysk Dec 25 '22 at 10:35
  • That seems to be the problem, you should disable the alias, or what should work: just type sshfs without any arguments – Edgar Magallon Dec 25 '22 at 10:43
  • Thanks.. That is really the problem. After renamed the alias sshfs to sshfs1; everything works flawlessly. – andrew_ysk Dec 25 '22 at 10:48
  • I rolled back your recent edit tagging the title with "SOLVED". If you have a solution, consider adding that solution as a separate answer and accept it later. Accepting an answer will mark the question as resolved. Please see https://unix.stackexchange.com/help/self-answer – Kusalananda Dec 25 '22 at 12:11
  • I didn't solve the problem by myself, it is Edgar Magallon who found the solution for me.. So i can't take credit for it. – andrew_ysk Dec 25 '22 at 14:51
  • @andrew_ysk I will post as an answer so you can mark as accepted :). – Edgar Magallon Dec 25 '22 at 19:07

1 Answers1

2

Your command did not work because sshfs had an alias for sshfs -p 8022 u0_a402@192.168.43.1:/ ~/sshfs-mount -o IdentityFile=~/.ssh/termux-rsa thus when you try to run your command this fails.

You can solve the problem by using:

  1. Unalias your command in your shell file (e.g. if it's bash then it'd be ~/.bashrc or ~/.bash_aliases perhaps)
  2. Simply run the command sshfs without arguments. But given that the alias use u0_a402@192.168.43.1:/ and you use u0_a402@192.168.43.189:/storage then this should not be useful.
  3. Prefix a \ to your command to avoid your shell uses the alias:
\sshfs -p 8022 u0_a402@192.168.43.189:/storage ~/sshfs-mount2 -o IdentityFile=~/.ssh/termux-rsa