Do photons have inertia? We all know the example where we say that a massless box containing photons has inertia, because the photons exert pressure of the inner walls of the box.
But my question is about a single photon traveling freely. Can it have inertia?

An aspect of this property is the tendency of objects to keep moving in a straight line at a constant speed, when no forces act upon them.

https://en.wikipedia.org/wiki/Inertia
There is another definition of inertia, that is, we need to exert force on an object when we try to remove it from the geodesic it is following.

a photon of energy E confined in massless, perfectly reflecting box has a rest mass because has inertia i.e. it takes force to accelerate the box
against the light pressure of the wave reflecting from inside the box: the impulse needed to reach speed v≪c is Ev/c2 so the system could be said to have rest mass and certainly inertial mass E/c2.
Photons of energy E always add effective gravitational mass E/c2 to the T00 term in the stress energy tensor "source". So they have gravitational mass E/c2 and indeed there are electrovac solutions of the EFEs where intense light acts on itself through gravity. So inertial mass = gravitational mass

Photon: speed and mass
This answer specifically states that a photon, having stress-energy, contributes to the stress-energy tensor, thus has gravitational mass, and this fact together with the fact that photons do have their own gravitational effects means that inertial mass=gravitational mass for the photon.
Though, many on this site identify inertia with solely massive objects.
Now just like when removing a massive object from its way on a geodesic, we need to use force on it "push it" away from the geodesic, we can do the same with a photon using a mirror.
Now if we have a photon, traveling on a geodesic, and use a mirror to remove it from the geodesic, we use force (constituted by the mirror) to remove the photon from the original geodesic, and the photon will exert pressure on the mirror (opposite force).
Now the photon's pressure (momentum transfer) on the mirror might be miniscule, but it does depend on its frequency, because for photons, energy and frequency and momentum are proportional. This could be interpreted as photons having inertia, proportional to their energy, just like for massive objects, inertia is proportional to their mass (which comes down again to stress-energy).
So ultimately, stress-energy content determines inertia, and that goes for both massive and massless particles.
Question:

*

*Do photons have inertia?

 A: yes they do, and for the reasons you sketched out. In principle, it would be possible to construct a mirror "sail" which, when deployed near a star, could be used to propel a spacecraft via the photon reaction force. However, the reaction force is tiny and to generate useful accelerations, a sail many miles across would be required.
Isaac Asimov may have written a science-fiction short story about "sun sailing" in the 1950's, I'll have to check my library to see if this is true.
A: 
Inertia is the resistance of any physical object to a change in its velocity. This includes changes to the object's speed, or direction of motion.

The photon is an elementary particle with zero mass, but it is described by a four vector. Its speed is always the velocity of light c, but its direction can change depending on the interaction with fields or particles.
Gravitational lensing is an observed phenomenon.

where we say that a massless box containing photons has inertia, because the photons exert pressure of the inner walls of the box.

A box containing photons cannot be massless. It will include the collective mass of the photons, which  is the length of the  four vector sum of the four vectors of box and photons. Only if all the four vectors of  zero mass are collinear in space will the total mass of photons be zero. So since there is a mass there is  inertia according to the definition above.
A: Somehow questions about inertia are related to these about a photon mass. The discussion about a photon mass can be conducted endlessly. In general:

*

*it is clear that a photon has no rest mass. Because it cannot be at rest. It can only exist after its emission until it is not absorbed. In between it moves at the speed of light.

*the emission of photons (energy) reduces the mass of the emitter Since Einstein, mass and energy have been directly related. The designation of photon energy as mass only makes sense if the calculations are different AND are accompanied by a measurable effect. This does not seem to be the case and apparently will not be the case in the future.

Inertia is the tendency of objects to keep moving in a straight line at a constant speed, when no forces act upon them. In general:

*

*for our usual surrounding two photons not interact, no force is exerted on each other. Therefore inertia is not manifested.

*high-energy photons are capable of annihilating themselves into two or more subatomic particles. I would not call these processes inert, because these photons disappear.

But there is another process in which a photon is deflected. If a photon flies near an edge, it is deflected. That is not surprising; both, photons and the surface electrons of the edge, have magnetic and electric fields, and these interactions are a good reason for the deflection of photons. From the fact of deflection it can be concluded that photons have inertia.
A: Electromagnetic waves exert a repulsive force on a conducting surface by first inducing a current into that surface, the resultant current produces a magnetic field in such a direction that it opposes the field that produced it, this is lenz's law or Faraday's law
https://en.wikipedia.org/wiki/Lenz%27s_law
If this can be construed to be inertia then so be it.
