Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Hostid in a Linux machine

Status
Not open for further replies.

edaguy69

Advanced Member level 4
Joined
Dec 11, 2002
Messages
119
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,298
Location
silicon land
Activity points
949
linux hostid

At a termal iwth R7.2. I type host id and i got a number. Anyone know wherethis number come from?
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
hostid linux

You can find hostid command in sh-util-2.0-i386-1 package.
Download sh-util-2.0 source and will
find hostid.c in src directory.
You'll see that host id you can get with function:
long gethostid();
see also:
int sethostid(long hostid);

type
man gethostid
and
man sethostid
and read man pages :))))
 

edaguy69

Advanced Member level 4
Joined
Dec 11, 2002
Messages
119
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,298
Location
silicon land
Activity points
949
flexlm linux hostid

No, you misunderstood me. The question I ask is where this hostid come from. In a workstation, the hostid is programmed by the manufacturer in a eeprom(or flassh) BIOS. Some EDA application get the ID from a dongle. NIC address and hard drive signature can be a source of hostid. What I ask here is how the Linux OS calculate to give us a hostid number.
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
flexlm how is hostid calculated?

ok... :))
may be this call is described in libc or glibc or others... I don't know, but can see, if you want. There you can find right way how to calculate default value for hostid. Next lines are taken from man page of gethostid:

"This normally resembles the Internet address for the local machine, as returned by gethostbyname(3), and thus
usually never needs to be set."

May be gethostid() or sethostid()
is a syscall to kernel, I don't
know, at this moment, but I told
you, that If you want, I can see
:))))

to set new hostid, you must have superuser privilegies...
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
how to change hostid

I think that default value is based on Ethernet address or HDD serial or model, firmware version and etc...

you can see also
hdparm command

and this ioctl

ioctl(fd,HDIO_GET_IDENTITY,id);

where fd is file descriptor for
/dev/hda for example with open()
and id is struct hd_driveid.

:)))
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
linux machine id

btw I'm with Slackware 8.1
 

edaguy69

Advanced Member level 4
Joined
Dec 11, 2002
Messages
119
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,298
Location
silicon land
Activity points
949
how to find the host id in windows machine

wzdreamer said:
ok... :))


to set new hostid, you must have superuser privilegies...
If you can set the host id, how can the EDA protect they software. They are not stupid ! Remember the software in linux is protect by Globelstrotter Flexlm. The host id have to be a fix string, it's can't be modified easily
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
host id/machine id or dongle number

I can't understand why you can't change your MAC? or DISK Id, which is your volume serial, if you use Windows...
You can change host id easy, if the system is yours... but you can't make valid license easy!!!!

If you have a valid license you can adjust your PC to work with it... But how to make valid license?????

I did it for some tools... i.e. Xilinx foundation ISE 4.2i....

I copied and install the CDs... take valid license from my friends, who bought it and changed my MAC address... with simple i2c modifications....
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
sh-util-2.0-i386-1 gethostid

You are right that Flex LM is serious copyright protection.... but not perfect...

there aren't perfect copyright protection....

I have my own license manager similar to FLEX lm in ideology.... but differs in some cases... I don't believe that it's better than FLEXlm... but it's mine :))))
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
how to find host id of linux server

now i wrote a simple source for you
it works....
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
/etc/hostid

#include <stdio.h>
#include <unistd.h>

int main() {
long id,res;

// get real (default) hostid
id = gethostid();
printf("current hostid is: %x\n",id);
// set new hostid if is superuser
res = sethostid(0x11223344);
if (res == 0) printf("if result is zero - success! (%d) \n",res);
// check if it is changed....
id = gethostid();
printf("current hostid is: %x ;-PPPppppp\n",id);
}
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
how to find host id of system, linux

compile with

gcc -o changehostid changehostid.c

where changehostid.c is the source, which I pasted...
and changehostid is the binary...

run it with
./changehostid

and you'll see the result...

;))))

don't forget that you must be a superuser.... i.e. root

:)))))
 

mariaR

Advanced Member level 4
Joined
Feb 28, 2003
Messages
110
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
697
fix hostid linux

That's good. I tested. it works
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
changing the host id in windows

I know, that works :)))

Never!!! Never forget this:
"Root CAN DO EVERYTHING on its own system!"

success...

but don't forget the label on the top of the forum
"Software piracy is wrong!"

btw I'm software and hardware developer :)))

be well,
Wazard Dreamer
 

edaguy69

Advanced Member level 4
Joined
Dec 11, 2002
Messages
119
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,298
Location
silicon land
Activity points
949
set host id i386

Hey smart Wazard Dreamer,
Can you show me how to do it easily with Sun machine .
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
change hdd model

I haven't sun... sorry...

If you want - give me root access to your Sun workstation :)))
 

steve88

Member level 1
Joined
Mar 21, 2002
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
181
hostid of a linux machine

Hi wzdreamer,

Does the proposed way change Linux host ID permanently? Or I shall ask this question by below separate ones :

1. Will the new host ID be valid in current shell only?

2. Or will the new host ID be valid in all shells open afterwards?

3. Or will the new host ID be valid even after next power-on?

If the new host ID be valid in current shell only, and not spreading over other shells, this might mean multiple host IDs at the same time at one machine, and mean multiple.....
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
cant set specific hostid

no multiple hostids... you know.....

after power-off and power-on will be restored default value.... value, which you will see in first running of the program, which i paste...

If your problem is to change it permamently, after power down, the right way is different :)))

but have you needs to change it permanently, when you can change it every time, when you needs using this tool.
You can add it in /etc/rc.d/rc.local
and it will be executed each time when you reboot your system...

steve88 did you try it?
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
slackware thunderlan

hehe...
permanently changes ;PPpppp

may be the question of edaguy69 is:
"Where is hidden hostid?"

I don't know at this moment... but can see
if you are looking for...

:)))
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,167
hostid adresse mac linux

Hmmmm,
"permanentlly" changed hostid is stored it /etc/hostid...
So you haven't needs to change it every time, when you reboot
your system... next time, when you type hostid, it will be
read from /etc/hostid
To restore original hostid, just remove /etc/hostid
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top