Here are all the options I can think of for leg training outside of a rack, something I've had to deal with for a while. Obviously, each has its own pros and cons.
Clean the bar and do front squats
Zercher squats, you deadlift the bar to your knees, then holding the bar in the crook of your elbows, squat
Barbell hack squats, a deadlift with the bar behind your legs
Romanian deadlifts, if you need to, google them
Deadlifts from a deficit, the bar starting right on top of your feet
Dumbell squats, grab 2 heavy dumbells and go high reps
Belt squats, if you've got some way of doing them
Lunges, you know the drill
Step ups, find a 12" block to step on to, get some weight on your back, step up
Jefferson squats, these are just weird but here for the sake of completeness
Good mornings, clean the bar up and push jerk on to your back, obviously lighter weight only
Glute ham raises, plenty of guides for these around
Pistols (1 legged squat), can be done weighted
Can obviously throw in leg extensions/curls if the machines are there. I'm a fan of zerchers and hack squats, but neither of them are exactly comfortable and not ideal. I'm fairly posterior dominant and my hack squats are in honesty more of a total back and glute exercise than a quad one. My zerchers definitely felt like more of a heavy as hell good morning than quads. Thats mostly down to form though. I do them that way due to a combination of ego and wanting to focus on my crappy deadlift.
Unless you meant that you had no access to barbells at all then....