1

This question already has an answer here:

I have two machines that were setup exactly the same with the same name and users and everything exactly the same. Each machine has two users with this names userA (userA@UserA) and userB (userB@UserA). I've connected both machines using a cable and setup a network wired connection and then ping and they both can see each other. This is how the etc/hosts look like in both machines:

127.0.0.1   localhost
127.0.1.1   UserA

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.0.1    master
192.168.0.2    slave

what I want to do is to change the UserA from both machines to make one named master and the other called slave so that on the master the users will be like this (userA@master and userB@master) while on the slave they will be (userA@slave and userB@slave).

The other thing I want to be able to do it is running this command:

userB@master:~$ ssh-copy-id -i $HOME/.ssh/id_rsa.pub userB@slave

but the problem when I run it I get this error:

/usr/bin/ssh-copy-id: ERROR: No identities found

So if anyone could please advise.

marked as duplicate by Wilf, psusi, Elder Geek, waltinator, Mitch Dec 24 '14 at 6:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Well, are there any identities to copy. ;) In other words, have you run ssh-keygen on master? – fkraiem Oct 7 '14 at 15:33
  • Isn't this question about changing the hostname (the part before ssh-copy-id comes into play)? – Jan Oct 7 '14 at 16:57
  • @fkraiem i think so, as i've followed the steps here michael-noll.com/tutorials/… and now trying to follow the steps found here to make a multinode cluster michael-noll.com/tutorials/… , but how to check whether the ssh-key is run on the master or not? – Tak Oct 7 '14 at 22:25
  • @Jan yes, i want to do this but i don't know how – Tak Oct 7 '14 at 22:27
  • It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for atleast one of your questions. Thanks! – guntbert Dec 15 '14 at 18:24
1

Question 1

How can I change the hostname?

To change the hostname of a Linux machine, use the hostname command. Also read the manpage, it has some more relevant information.

If you need to change the hostname as the other machine resolves it, change the /etc/hosts file, if you used that.

Question 2

I want to be able to do it is running this command: userB@master:~$ ssh-copy-id [...]

You have to generate ssh keys first, use ssh-keygen (manpage) for that.

  • Thanks for your answer! Regarding Question1, could you tell me what changes needed to be done in the hosts file? I already posted it in my question. Regarding question2, is there a way to check if there is an already key generated? – Tak Oct 8 '14 at 7:04
  • @shepherd Please ask your questions separately so that others with the same problem can benefit. Comments are for asking for clarification, etc... – Elder Geek Dec 24 '14 at 1:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.