mikeeusa wrote:How does one set these limits in ssh? Do you set something in the config file? (I've googled and turned up nothing). What are good defaults for the data one?
I don't know that there's any configuration option to set them. It may be necessary to add the appropriate calls to the source and recompile it. If so, look for calls to the set*id family of functions, since that'll be happening close to where the sshd is about to spawn a user's shell. A quick run through the source shows that finding this isn't as easy as I'd expected. I'd guess that placing the new calls in do_exec will have the desired effect. You could verify this by running the candidate sshd on an alternate port, logging in through it, and then checking the limits imposed upon that login. Note that most shells show soft limits by default, whereas I've been advocating a hard limit.
The data limit will vary depending on what the users are supposed to be running. I tend to like setting a data limit to be no more than system physical memory. However, Java virtual machines are absolute memory hogs, and often will not run under such a limit. Some heavy data-processing software may also chafe under such limits. If you're unsure, you could try setting a limit in the systemwide profile directory, and include instructions to report programs which fail under the limit you've set. You could make it a soft limit so that the users can raise it up without waiting for a response. Once you've run long enough that you're comfortable all the users' programs will work with that limit, build it into the sshd.
Note that the user can bypass both hard and soft limits in the system profiles, so it's best to use that only when testing. For instance,
ssh -t mike-host.localdomain tcsh -f would allocate a terminal (-t), not be a login shell (no -l), and skip all profile files (-f).