LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 02: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, 02:50 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
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, 02:53 PM   #3
Seregwethrin
Member
 
Registered: Feb 2008
Posts: 112

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

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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, 02:54 PM   #5
Seregwethrin
Member
 
Registered: Feb 2008
Posts: 112

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


Reply



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 04:27 PM
How to disable remore ssh login access of "root" user. ashishshukla Linux - General 3 10-07-2008 08:55 AM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:36 AM.

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
Open Source Consulting | Domain Registration