LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh without a Password (http://www.linuxquestions.org/questions/linux-newbie-8/ssh-without-a-password-590966/)

paragkalra 10-11-2007 02:09 AM

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.

acid_kewpie 10-11-2007 02:40 AM

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.

paragkalra 10-11-2007 02:48 AM

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.

dafunks 10-11-2007 03:15 AM

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?

paragkalra 10-11-2007 03:21 AM

Is there any way I can ssh to that machine?

acid_kewpie 10-11-2007 03:26 AM

so did you change the password or not?

paragkalra 10-11-2007 03:48 AM

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.

jschiwal 10-11-2007 03:57 AM

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.

Tinkster 10-11-2007 04:38 AM

Quote:

Originally Posted by paragkalra (Post 2920535)
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

syg00 10-11-2007 06:01 AM

C'mon Tink, don't hold back - say what you really think ...:p

dafunks 10-11-2007 06:21 AM

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!!!!

paragkalra 11-04-2007 12:39 PM

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.

acid_kewpie 11-04-2007 01:11 PM

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.

paragkalra 11-04-2007 01:48 PM

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.

jschiwal 11-04-2007 03:05 PM

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."


All times are GMT -5. The time now is 01:13 PM.