Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: paulmancan2 on March 22, 2005, 11:26:31 PM
-
I'm used to accesing my server by SSHing in as root. I'd like to drop this bad habbit so I gave my user a bash shell.
When I su to root however, do I not get root's path variables? ie. as root this way gives me ""command not found" on commands I can use by logging in directly as root.
Thanks!
-
paulmancan2
> I'm used to accesing my server by SSHing in as
> root. I'd like to drop this bad habbit so I gave
> my user a bash shell.
I need to do this also.
I gather we need to give the user sudo rights and configure the shell for them (with the path variables)
Then issue commands like
sudo whatever
I'm sure the informatiomn is out there somewhere, can anyone provde the specifics please.
-
> I'm sure the informatiomn is out there somewhere, can anyone provde the specifics please.
well I already knew to look at
/etc/sudoers
and of course we can all do
man sudoers
I just never got around to fully working it out.
Anybody have a sample /etc/suders file they want to share ?
-
paulmancan2
log in as root and do
chsh -s /bin/bash username
to stop the user having access do
chsh -s /bin/sshell username
You can use different shells depending on your requirements:
chsh -s /bin/csh username
chsh -s /bin/bsh username
chsh -s /bin/bash username
chsh -s /bin/bash2 username
As well you probably want to set up sudoers list to allow users to have root access rights.
There is a contrib by daniel van raay that adds a panel to server manager to set sudo access for users.
...or using command prompt
you need to do something like this in /etc/sudoers
# User privilege specification
root ALL=(ALL) ALL
username ALL=(ALL) ALL
You would issue commands like
sudo command
I think the password expiry time is 5 minutes by default so you have to re-enter it after that time.
-
I'm used to accesing my server by SSHing in as root. I'd like to drop this bad habbit so I gave my user a bash shell.
When I su to root however, do I not get root's path variables?
Try "su -".
-
Thanks Charlie that is the ticket. If you have a chance would you explain why this is (ie. su root vs su -) Thanks!
-
Thanks Charlie that is the ticket. If you have a chance would you explain why this is (ie. su root vs su -)
"man su".
[Remember that Google is your friend. Knows more than I do, and works 24 hours.]
-
Google is down right now :P
My apologies for the laziness.