LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2007, 01:09 AM   #1
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Rep: Reputation: 31
Question ssh without a Password


One of the machine in my network doesn't have a root Password. I have logged out of my machine. When I ssh that machine from some other host in the network it asks for the password. But since it doesn't have any password, simply pressing return key doesn't allow me to login. Please help. It's urgent.
 
Old 10-11-2007, 01:40 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
well add a password would be the very obvious solution... why on earth would you have no root password? failing that ssh to the device with an alternative account and then su to root, as you shouldn't ssh as root anyway. alternatively set up an rsa / dsa preshared key to allow you to securely authenticate without the password phase.
 
Old 10-11-2007, 01:48 AM   #3
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
The problem is that the machine which is not having a root password doesn't have a monitor. So far we all used to do ssh and work on it. But now since we have changed the password and restarted the machine neither we can login to that machine nor can we ssh to it. Arranging a monitor for it is not possible.
 
Old 10-11-2007, 02:15 AM   #4
dafunks
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 12
Posts: 62

Rep: Reputation: 15
Looks like someone has went, "oh, unprotected machine?" .. "Thank you very much" ..

[root@localhost /]# passwd
[root@localhost /]# New password (? for help): owned
[root@localhost /]# New password (again): owned

Why do you have no physical access to this machine?
 
Old 10-11-2007, 02:21 AM   #5
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
Question

Is there any way I can ssh to that machine?
 
Old 10-11-2007, 02:26 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
so did you change the password or not?
 
Old 10-11-2007, 02:48 AM   #7
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
Let me explain the scenario once again. We have one server type machine which doesn't have a monitor. All the members connect to it using ssh and after performing their jobs they logout. We never used to shut down or restart this machine. However oneday we enabled password-less login for user root on the server(#passwd -d root). Accidentally one of our member rebooted the machine using (#init 6). Now since the server doesn't have the monitor we can't login back and change the password and also its not allowing the other machines on the network to login using ssh. Although it asks for password but on simply entering the return key (since root doesn't have the password) it disconnects after two attempts.
 
Old 10-11-2007, 02:57 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
Log in as one of the normal users, su to root and then run the passwd program to create a root passwd.
You shouldn't allow root logins anyway.
 
Old 10-11-2007, 03:38 AM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Quote:
Originally Posted by paragkalra View Post
Let me explain the scenario once again. We have one server type machine which doesn't have a monitor. All the members connect to it using ssh and after performing their jobs they logout. We never used to shut down or restart this machine. However oneday we enabled password-less login for user root on the server(#passwd -d root). Accidentally one of our member rebooted the machine using (#init 6). Now since the server doesn't have the monitor we can't login back and change the password and also its not allowing the other machines on the network to login using ssh. Although it asks for password but on simply entering the return key (since root doesn't have the password) it disconnects after two attempts.

Love the enthusiasm in your signature mate, but if you're even
partly responsible for the kind of set-up your describing here
you shouldn't be calling yourself "Linux-man".

This is just insane. Really you should be put in the stocks.
Sorry, this isn't helping you, but it had to be said. That's
about as dumb as playing with matches in a tub full of fuel.


Cheers,
Tink
 
Old 10-11-2007, 05:01 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,826

Rep: Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006
C'mon Tink, don't hold back - say what you really think ...
 
Old 10-11-2007, 05:21 AM   #11
dafunks
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 12
Posts: 62

Rep: Reputation: 15
The forums are highly charged this morning, I can fee the tension in the air, so much so ...... i've just punched my work colleague in the face. DAMN YOU LQ!!!!
 
Old 11-04-2007, 11:39 AM   #12
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
Few weeks back when I posted my query, everyone bashed me instead of helping me. However I have learnt the lesson hardway. So next time when any of you want to do or enable passwordless ssh, just edit the file /etc/ssh/sshd_config and place the following entry:
Quote:
PermitEmptyPasswords yes
Restart the sshd service:

Quote:
#service sshd restart
Thats it you are done. Now you can ssh to a machine with a username who doesn't have a password.
 
Old 11-04-2007, 12:11 PM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
there's a reason that is disabled... you got into that state from a very poor security policy and you're trying to make it even worse it seems.
 
Old 11-04-2007, 12:48 PM   #14
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
I am being misunderstood, I guess. See I am a small kid in front of you guys (I am just 22). Your experience on NIX is more than my age. So I am in no position what so ever to argue with you guys. But my point is that I am not running a production house (But I intend to oneday). I try to discover Linux every day at my home. And one day while playing with Linux I was caught in unconfortable position. My question that day was how to enable passwordless login through ssh (Sorry, if I was not clear). Actually the topic and question was off tracked right from the first reply. Everyone dragged me under hammer. I know what I asked meant poor security, but that was not my question. I we people can't answer or don't wish to answer, at least we should not discourage people specially newbies like me. I know newbies don't have command over Linux and therefore we are called newbies.

The bottom line is we should be precise with our replies. Don't curse or abuse people. Don't take the question miles away from it's topic. Don't be worried about teaching someone a lesson. He or she would any how learn it from the difficulties.

What we should focus is to help others and encourage people to be free on forums specially newbies. More than anything else it would encourage more and more people to use LINUX.
 
Old 11-04-2007, 02:05 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
I'm sure borrowing a keyboard and monitor & even a video card if it doesn't have one from one of the systems you use to log in shouldn't be too hard. The root account should have a password. Also, you should be logging in as a regular user and only su to root when you need to do administrative work.

One thing you could try without a monitor is to add a keyboard and log into root at the terminal blindly. After you are sure the machine has had time to boot up, press [CTRL]-[ALT]-F1 to be sure that the machine is at a virtual terminal, then enter "root" & enter.
Next enter "passwd[RETURN-KEY]a-new-password".

---

Imagine going to the doctor and saying your head hurts when you hit it with a ball peen hammer.
The doctor will probably berate you as well before saying "Well don't hit you head with a ball peen hammer."

Last edited by jschiwal; 11-04-2007 at 02:07 PM.
 
  


Reply

Tags
password, passwordless, ssh


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
need help with no password ssh and ssh-agent hedpe Linux - Networking 3 02-08-2007 08:49 PM
SSH without password Ephracis Linux - Security 4 02-25-2005 02:30 PM
SSH without password? Phaethar Linux - Networking 1 09-18-2004 06:31 AM
ssh password ssudhi Linux - Newbie 6 05-13-2004 09:30 PM
password less SSH maaand Linux - Networking 0 04-23-2002 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:15 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