LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-21-2009, 03:42 PM   #1
Seregwethrin
Member
 
Registered: Feb 2008
Posts: 112

Rep: Reputation: 16
SSH root login from different user


Hello;

I created a new user lets call it X.

I disallowed the root login from SSH, so I login with X and after I call "#su root" command.

But when I login that way, I can't use some commands like "service".

I can access all the files, I can even change the sshd_config file but some commands say "not found".

Do I need to get X to a group? Or make it some priveledges etc? What should I have to do to run this free of problems?
 
Old 05-21-2009, 03:50 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Seregwethrin
I disallowed the root login from SSH, so I login with X and after I call "#su root" command.

But when I login that way, I can't use some commands like "service".
Use su - (note the hyphen) to get root's full environment, which includes PATH.
 
Old 05-21-2009, 03:53 PM   #3
Seregwethrin
Member
 
Registered: Feb 2008
Posts: 112

Original Poster
Rep: Reputation: 16
Thanks, working good
 
Old 05-21-2009, 03:53 PM   #4
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Using "su" without any arguments gives you root-level permissions, but doesn't actually log you in as root. If you run the command with the argument "-", it will give you the proper root user environment. The problem you are having is that your normal user account doesn't have all of the system paths added to the $PATH environment variable.

You also don't need to specify "root" as the user, as it will do that by default. The proper command to do what you want would simply be:

Code:
su -
 
Old 05-21-2009, 03:54 PM   #5
Seregwethrin
Member
 
Registered: Feb 2008
Posts: 112

Original Poster
Rep: Reputation: 16
Well, that made me understand more, thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 05:27 PM
How to disable remore ssh login access of "root" user. ashishshukla Linux - General 3 10-07-2008 09:55 AM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 04:44 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 12:39 PM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-06-2004 12:40 AM


All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration