Domanda Nascondere hostname del PC

Johnsum

Utente Electrum
22 Gennaio 2017
218
56
7
146
Ciao a tutti,
Esiste un metodo semplice per nascondere all'esigenza il proprio hostname del proprio pc collegato in rete locale?
Magari che potesse anche risultare solo un asterisco (*) al posto del nome.
Grazie
 
Meglio di niente. Posso comunque mettere gli asterischi.
Come si fa in windows e linux?
Grazie
Non sono sicuro dell'asterisco, comunque su Linux basta modificare /etc/hostname (Cambia in base alla distro mi pare).

Windows invece utilizza il nome dell'utente, quindi bisogna rinominare quello ;)
 
Meglio di niente. Posso comunque mettere gli asterischi.
Come si fa in windows e linux?
Grazie
I sistemi operativi si comportano differentemente con gli hostname, tra le documentazioni dovrebbero essere illustrati i diversi charset legali per gli OS.

Per Windows:
In DNS computer names, use only the characters that are listed in RFC 1123. These characters include A–Z, a–z, 0–9, and the hyphen (-). In Windows Server 2003, DNS allows most UTF-8 characters in names. However, do not use extended ASCII or UTF-8 characters unless all the DNS servers in your environment support them.
In breve, dalla A alla Z, dalla a alla z, da 0 a 9 e il trattino - con le varie eccezioni indicate sopra.

Per Linux:
Each element of the hostname must be from 1 to 63 characters long and
the entire hostname, including the dots, can be at most 253
characters long. Valid characters for hostnames are ASCII(7) letters
from a to z, the digits from 0 to 9, and the hyphen (-). A hostname
may not start with a hyphen.
 
Perché non scrivi uno script (in Bash, Python o quello che vuoi) che randomizzi l'hostname ad ogni riavvio? Ne trovi di diversi anche online.
 
Interessante. Dove ne trovo uno affidabile? Grazie

Qui

una volta creato il file:

mv miofile /etc/init.d
chmod +x /etc/init.d/miofile
update-rc.d miofile defaults (per eseguirlo all'avvio. Per rimuovere l'esecuzione automatica: update-rc.d miofile remove)

reboot


Un'ultima cosa: gli script init hanno bisogno degli headers LSB, per cui dovrai aggiungere una roba del genere all'inizio del codice:

#!/bin/bash

### BEGIN INIT INFO
# Provides: hostname
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: random hostname.
# Description: Changes the hostname at boot time
### END INIT INFO



Good luck!
 
  • Mi piace
Reazioni: Johnsum