linux - how to create a user non-login but can use ssh -CD create local socks proxy
2014-07
I want share my VPS to other users, but they can only use it as a socks proxy server.
It can allow ther user do ssh -CD 1080 -N user@host
. But he can never login to the server, and modify any file.
How to create a user like this.
I'd like to create a user and a group both called subversion
on a RHEL 5 system. I looked at the man page for useradd
and I guess the command would be just be...
useradd subversion
However, not sure how to avoid creating a home dir. Also, I don't want it to be a user that can log in to the system.
The main purpose is just to provide an owner for a SVN repository.
You can use the -M
switch (make sure it's a capital) to ensure no home directory will be created:
useradd -M subversion
then lock the account to prevent logging in:
usermod -L subversion
useradd -r subversion
per man useradd
:
-r, --system create a system account
The -r flag will create a system user - one which does not have a password, a home dir and is unable to login.