This is technically off-topic; but i can already do ssh defaultuser@Xperia10III with no config at all. Presumably it is my router picking up the hostname and adding it to dns, should be pretty normal…
@thigg : …and where in the phone is the name ‘Xperia10III’ set?
until now I always logged into the phone with ‘ssh defaultuser@192.168.0.x’, [enter] , then terminal asked me for password, then i was logged in. The host address (x) i read from Settings/developer tools.
edit: Does this also work, if the IP-address the phone gets from the router, changes sometimes?
This is the hostname, you can either see it in your router or in /etc/hostname. And it works, when the ip changes. Also for maximum convenience i would recommend using a ssh key.
For that, do on your computer:
ssh-keygen
ssh-copy-id phone
this deploys your newly generated key on your phone. (you can simply enter an empty password for ssh-keygen, if you deem files on your pc as secure)
afterwards you can just use ssh phone without ever typing your password again (from this user on this computer).
Also rsync, scp,… Work with all of these (keys and host entries)
I didn’t have a ‘~/.ssh/config’ file on my computer (Ubuntu Linux), so I created one. But it doesn’t work. Computer reports: ‘ssh: Could not resolve hostname xperia10-dualsim: Temporary failure in name resolution’ , doesn’t find the IP-address of the phone.
So in your instance the computer doesn’t ‘know’ the device.
I set up a fixed ip address for devices like my PCs and phone on the router, then give them a name in my hosts file.
You can then ssh username@xperia10xiii
eg:
192.168.1.266 xperia10xiii
I have not yet a real router, I use one of my Sailfish phones with its mobile access point as main internet gateway and have no other.
Connected to this access point are a TP-Link DAP-1325 WLAN range extender, via cable a printer, and another Sony and a Volla Sailfish phone also via WLAN.
So can I configure all this routing in the one phone thats the access point?
The TP Link has no option for such settings on it’s config page, it’s too simple.
Another way to set a static ip address is by defining it in the client.
There is a risk in a more ‘normal’ network of ip addresses being duplicated if the router provisions the same ip as defined by another client, but you should be ok.
In your case I would make a note of your phone ip (from the Developer tools section of Settings) and use that. I would also do the same on your computer and as many devices as possible in order to avoid the possibility of duplication.
I haven’t done this on a linux system (years ago I used to set static ips on my Windows devices, but since then I’ve used the router where required), but I assume something like this might work:
I would make backups of any files before editing them just in case
There’s a guide here
This content in ‘~/.ssh/config’ works as long the phone has this dynamic IP address:
Host volla
Hostname 192.168.0.3
User defaultuser
So I have only to type ‘ssh volla’ and immediately there comes the password prompt. Thats very good, but i fear it will stop to work as soon the phone will get another dynamic IP address anytime later. But a first step is done. Thank you very much!
Previous experiments with:
Host volla
Hostname VollaPhone
User defaultuser
did NOT work. (VollaPhone is the phones network name entered in 'Settings/WLAN/pulldown/advanced/Hostname )
A locally-assigned hostname can not automatically be addressed on the network unless the router/DNS server/DHCP server handles it.. Most devices tell the DHCP server (usually your router) its hostname, and the router must have the functionality to set up an entry in its DNS table for that hostname and the dynamically-assigned IP adress. Many basic routers do not do this.
Some routers, even if they do not automatically fill in its DNS table, let you manually assign an arbitrary hostname to a MAC address, so that the device with that MAC is always adressable using the hostname you decide.
Unfortunately, I cannot give any kind of instructions for this, you have to tey figure it out.
I use fixed IP address in the phone and an entry in ~/.ssh/config on my Linux computers. The ssh keys are also in ~/.ssh . So no router functionality necessary.