I’ve an assignment for school to research about namespaces.
For all of them I’ve made examples but UTS is not simple to demonstrate.
I’ve read UTS namespace is often used in vservers for admin purposes (naming machines in a local network) and I’d like to show so by having 2 SSH servers in 2 different UTS namespaces and showing that connection is established by ‘ssh user@hostnameinns1’ and ‘ssh user@hostnameinns2’.
An ssh server is run at system startup while in a terminal I’m doing:
$ sudo unshare -u $ hostname hostnameinns2 $ service sshd start
My actual set up is an Ubuntu VM inside Windows with port 22 forwarding and network in ‘bridged mode’. I’m connecting from Windows but unfortunately it only connects to the first ns (the original/system one) but not to the unshared one:
ssh: Could not resolve hostname hostnameinns2: No such host is known.
$ service sshd stop in the first ns before starting it in the second one doesn’t help.
Any help is really appreciated.
Thanks in advance.