Hafs bin Asim bin Umar bin Khattab reported,

We were with Ibn Umar on a journey. He led us in prayer, and when we finished, we left along with him. He turned and saw some people praying.He asked, "What are these people doing?"I replied, "They are performing voluntary prayers."He said, "If I were going to perform voluntary prayers, I would have completed my prayer in full. Nephew, I accompanied the Messenger of Allah ﷺ, and he never prayed more than two rakahs while traveling, until Allah took him. Then I accompanied Abu Bakr, and he never prayed more than two rakahs. Then I accompanied Umar, and he never prayed more than two rakahs. Then I accompanied Uthman, and he never prayed more than two rakahs, until Allah took them. And Allah says, 'Indeed, in the Messenger of Allah you have an excellent example' [Ahzab 33:21]."

Ibn Majah 1071

Sahih

حدثنا أبو بكر بن خلاد الباهلي حدثنا أبو عامر

عن عيسى بن حفص بن عاصم بن عمر بن الخطاب حدثني أبي قال

كنا مع ابن عمر في سفر فصلى بنا ثم انصرفنا معه وانصرف قال فالتفت فرأى أناسا يصلون فقال ما يصنع هؤلاء قلت يسبحون قال لو كنت مسبحا لأتممت صلاتي يا ابن أخي إني صحبت رسول الله ﷺ فلم يزد على ركعتين في السفر حتى قبضه الله ثم صحبت أبا بكر فلم يزد على ركعتين ثم صحبت عمر فلم يزد على ركعتين ثم صحبت عثمان فلم يزد على ركعتين حتى قبضهم الله والله يقول {لقد كان لكم في رسول الله أسوة حسنة}

ابن ماجه 1071صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Voluntary prayers during travel
Numbering
Darussalam 1071
Ibn Majah 1071