LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-03-2007, 02:46 AM   #1
xitrum1110
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Rep: Reputation: 0
How i can remote login using root user ?


I 'm using PuTTY to remote login with root user to my linux server(Fedora core 2, Open SSH) . I changed password and can't remmber . So, i direct login to my server in single mode(some one in forum has instructed me). I using passwd to change root password (some topic has instructed me how to recover password). Right now, i can direct login to server in root user, but can't remote login.
I can remote login with an old normal user, but can't su like before!
I checked sshd_config, and PermitRootLogin yes already.
What is the problem?
Please please help me!, i need it so bad!(i 'm a newbie in linux) (thanks so much for any advice! )

Sorry because of my poor english!

Last edited by xitrum1110; 08-03-2007 at 03:52 AM.
 
Old 08-03-2007, 03:11 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
if i was you, i'd login locally, install sudo, edit the sudoers file (using visudo) and add my normal username.
then login from remote site, using the normal username and using sudo gain root privileges.

though this aint really answering your question, it's what is commonly done... as it is discouraged to login as root from a remote site.
 
Old 08-03-2007, 03:12 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I would definitely set AllowRootLogin No -- allowing root logins trough SSH means allowing anybody do brute force attacks against root account, for a start. Generally just *not* a good idea. Instead log in as a regular user and use either su or sudo depending on which one you have or prefer. Definitely, if you can, sudo instead of su (means configuring /etc/sudoers and possibly group 'sudo').

Another matter is why 'su' doesn't work. It really really should. How about if you run 'su' as root to become some other user?
Code:
su anotherusername
does that work, or not? What error you get if you do that on an account where it "doesn't work"? Better get that fixed first..
 
Old 08-03-2007, 03:18 AM   #4
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
Have you made sure the line is not commented? It means you need to remove the "#" before the line because otherwise it is not read. You also need to restart the server for the changes to take effect (IIRC):
Code:
kill -HUP $(cat /var/run/sshd.pid)
But I don't know why you can't su from your user. Perhaps if you explained exactly what you did (which password you changed and so on) then we might be able to help you.

[EDIT]But as has been said, permitting root login can be dangerous if you have a weak password on the root account[EDIT]

Last edited by bakfupai; 08-03-2007 at 03:21 AM.
 
Old 08-03-2007, 03:51 AM   #5
xitrum1110
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks so so so much for all your quick replies!
bakfupai said:"It means you need to remove the "#" "----> yes, it was already removed and i restarted server too!

b0uncer said:"Another matter is why 'su' doesn't work. It really really should. How about if you run 'su' as root to become some other user?
does that work"----->Yes that worked if i direct login to server.


Nathanael: Yeah, i tried sudo too, but it don't work




When i direct login to server I can use su root or whaterver user!

But when i remote login by a user, i can't su root , it displays :"su: incorrect password" but i can use that password to direct login to server in root user.

I have just create a new user.
And i can't remote login with that user too!
 
Old 08-03-2007, 03:51 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'll just offer a small clarification to what Nathanael wrote. Rather than adding your name in the sudoers fle (with visudo), make your self a member of the "wheel" group and uncomment the line in the sudoers file to allow yourself to use sudo.
 
Old 08-03-2007, 04:03 AM   #7
xitrum1110
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Original Poster
Rep: Reputation: 0
i forgot to explain what i did when i recover my root passwd:
Here is what i did:

I restart, in grub menu i press 'e', chose kernel, and press 'e' again , after that i insert an space and the number one '1' then press ENTER and 'b' and ENTER again.
Now i 'm in single mode
i type: passwd
and change root passwd
then restart

I had followed instruction from : http://www.go2linux.org/node/5
 
  


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 04:27 PM
remote login as root rob.rice Linux - Networking 12 12-13-2006 06:12 PM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
Help: cannot remote login as root tho_x_tran Linux - Security 7 09-11-2004 12:05 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:36 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
Open Source Consulting | Domain Registration