You are not logged in.
Hello!
I cannot understand how to have SSH use my laptop's new hostname.
My laptop's hostname is:
$ hostname
tpad
However, if I try to ssh from the Eeepc:
$ ssh user1@tpad
ssh: Could not resolve hostname tpad: Name or service not known
But if I connect to the old hostname:
$ ssh user1@sudoku
Welcome to tpad!
...
Where sudoku was my old hostname. Where does Arch go and find that hostname? I thought I got rid of it. Here are my relevant files:
$ cat /etc/hostname
tpad
$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost tpad
::1 localhost.localdomain localhost tpad
# EOF
$ cat /etc/idmapd.conf
[General]
Verbosity = 1
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = tpad
[Mapping]
Nobody-User = nobody
Nobody-Group = nobody
Thank you and all the best!
Last edited by sudoku (2013-08-11 07:54:44)
Offline
Have you changed the Host field in .ssh/config?
Offline
Do you mean ~/.ssh in the host machine (tpad/sudoku)? There is no config file:
$ ls ~/.ssh
authorized_keys id_rsa.pub known_hosts
$ grep -r -i sudoku ~/.ssh
./known_hosts:sudoku ecdsa-sha2-nistp256 [some very long string here]
./id_rsa.pub:ssh-rsa [another very long string here] user1@sudoku
Otherwise, if you mean /etc/ssh:
$ ls /etc/ssh
moduli ssh_host_dsa_key ssh_host_ecdsa_key.pub ssh_host_rsa_key sshd_config~
ssh_config ssh_host_dsa_key.pub ssh_host_key ssh_host_rsa_key.pub
ssh_config~ ssh_host_ecdsa_key ssh_host_key.pub sshd_config
A grep -r -i sudoku /etc/ssh finds occurrences in all files here apart from ssh_config and sshd_config.
Last edited by sudoku (2013-08-11 07:04:47)
Offline
You can create one, or delete your known_hosts. I'd opt for the former, myself...
Offline
I've removed the ~/.ssh folder.
However, it didn't solve much and I still have to SSH using sudoku although now it's asking me for a password.
Nothing changed by reinstalling openssh and removing /etc/ssh either. Where does Archlinux find that hostname?
Last edited by sudoku (2013-08-11 07:20:26)
Offline
You shouldn't indiscriminately remove those directories...
Create a .ssh/config on your EeePC with the following in it:
Host tpad
Hostname 192.168.1.XXX
Port 22
User user1
IdentityFile ~/.ssh/id_rsa
where the values for the IP address, port and private key are yours, etc...
Then issue:
ssh tpad
Offline
Ah! It worked. So it was actually some leftover setting in the Eeepc. Thank you for your help.
Offline