consider that charges of opposite signs attract each other. Then, when the positively charged object is near one end of the bar, such end is charged negatively by the atraction of the positive charges.
On the other end there are the positive charges, due to the repulsion of charge with the same signs.