SSH Keys – Password less authentication

I was trying to setup SSH Keys between two different flavors of Linux Host by following this Howto

I did run commands exactly as per mentioned in the how to; but it didn’t work. Error message as under

vin@CLIENT:~$ ssh vsa@192.0.0.10
vin@192.0.0.10’s password:
Last login: Mon May 22 10:45:03 2017 from 192.0.0.10
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: tty: command not found
-bash: uname: command not found

After googling and trail and error method finally found a fix.

Instead of Step 3 as per the above How to, use the below commands.

  1. Ensure on the server proper permissions set on the .ssh folder if not set permissions as

$chmod -R 775 .ssh (.ssh is located in user home directory e.g: /home/vin)

  1. Run this command to copy the Key file from client to server

$cat ~/.ssh/id_rsa.pub | ssh vin@192.0.0.10 ‘umask 0077; /bin/mkdir -p .ssh; /bin/cat >> .ssh/authorized_keys && echo “Done!”‘

After running above command, server 192.0.0.10 do not ask for password when user vin try to login.

vin@CLIENT:~$ ssh vin@192.0.0.10
Last login: Mon May 22 11:54:29 2017 from 192.0.0.10
[vin@SERVER ~]$

Advertisements

Wire free connect to Android Phone via SSH

I left my USB Type C cable cum charger in office yesterday and couldn’t transfer some files. I am aware of Shareit app but it doesn’t work in Linux. Both my laptop and phone are connected to wireless router.

After googling for while found a native and simplest way to connect to my android phone via SSH.

Installed SSHDroid on my phone and started the SSH service. From my Debian GNU Linux console started SSH session and connected to the IP of my phone and using SCP copied all those required files from phone to PC. BTW copied new songs from PC to phone as well 🙂