Such friendships usually take the form of a mentor relationship and it often starts with your skipper or other boss taking special interest in your performance and career development. But he or she will be very careful to keep official relationships official because they must be concerned with the performance of the department or unit as a whole and not play favorites. Typically such mentoring matures after you or your boss have been detached. But I should raise a caution flag. (An aid to navigation, if you will.)
You will notice that most, if not all, skippers or bosses will address you by your first name. The reverse is, of course, not in order. Don't think for a minute that because your skipper or boss addresses you by your first name that you are his or her friend. Not yet, anyway. Seniors will have occasion to chew you out (the more modern term is counseling) but don't think that because they use your first name on such occasions that they are counseling you as a friend. You are being "wire brushed" as an errant subordinate.
Moreover, your skippers are not social workers who are inordinately concerned about your "feelings", perceived inadequacies, or your self esteem. They are interested in whether or not you are pulling the wagon, doing your duty, and growing professionally, Friendship has absolutely nothing to do with it.
The Professional Naval Officer - A Course To Steer By
RADM James A. Winnefield