Can not ssh to server without a passwordTwo-step remote ssh without passwordServer does not accept public key for ssh login without passwordI'm trying to install my public key manually w/ scpSSH will not make a local connection without password promptHow can I ssh to a remote server with an automated password and no key?Logging in through ssh tunnel with rsa key still giving password promptssh login a second server without password?Cannot ssh without passwordAutomating SSh communication without Password PromptWhat are the precise relationships between the keys in a Multi-user SSH Installation?

Strong Password Detection in Python

Is it ok for parents to kiss and romance with each other while their 2- to 8-year-old child watches?

Is there a method for differentiating informative comments from commented out code?

Conditions for Roots of a quadratic equation at infinity

Would a Nikon FG 20 film SLR camera take pictures without batteries?

Found and corrected a mistake on someone's else paper -- praxis?

How to convert diagonal matrix to rectangular matrix

Users forgetting to regenerate PDF before sending it

Is it better in terms of durability to remove card+battery or to connect to charger/computer via USB-C?

Intern not wearing safety equipment; how could I have handled this differently?

Non-Chromatic Orchestral Instruments?

How insert vertex in face?

Why AI became applicable only after Nvidia's chips were available?

What kind of Chinook helicopter/airplane hybrid is this?

A sequence that changes sign finally at infinity?

Performance issue in code for reading line and testing for palindrome

Run Bash scripts in folder all at the same time

Did depressed people far more accurately estimate how many monsters they killed in a video game?

Publishing papers seem natural to many, while I find it really hard to think novel stuff to pursue till publication. How to cope up with this?

Correct notation for guitar fingerstyle

When I press the space bar it deletes the letters in front of it

Why is the Cauchy Distribution is so useful?

Generalized Behrend version for Grothendieck-Lefschetz trace formula

When do flights get cancelled due to fog?



Can not ssh to server without a password


Two-step remote ssh without passwordServer does not accept public key for ssh login without passwordI'm trying to install my public key manually w/ scpSSH will not make a local connection without password promptHow can I ssh to a remote server with an automated password and no key?Logging in through ssh tunnel with rsa key still giving password promptssh login a second server without password?Cannot ssh without passwordAutomating SSh communication without Password PromptWhat are the precise relationships between the keys in a Multi-user SSH Installation?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have two VM machines, and I want them to run a remote command on each other via ssh. I ran these commands on the first machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.148


Then I ran this command and it didn't ask for a password:



[root@fazi1 data1]# ssh root@192.168.254.148 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.7G 893M 6.5G 12% /
tmpfs 1.5G 16K 1.5G 1% /dev/shm
/dev/sda1 194M 41M 144M 22% /boot
/dev/sda2 11G 7.7G 2.4G 77% /data1
/dev/sda7 4.5G 539M 3.8G 13% /data2
/dev/sda5 7.7G 1.4G 6.0G 19% /opt


I ran these commands on the second machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.150


And when I wanted to check if it is working or not:



[root@fazi2 data1]# ssh root@192.168.254.150 df -h
root@192.168.254.150's password:


Why does it work the way I want on the first machine and act different on the second one?



What should I do? (I ran these commands a few times to make sure I didn't enter an incorrect password.)










share|improve this question



















  • 1





    It's usually a permissions problem either on the ~/.ssh directory or one of the files.

    – NickD
    Jun 30 at 5:00






  • 1





    @NickD do you mean the rwx? or a configuration inside files?

    – BlackCrystal
    Jun 30 at 5:11






  • 1





    What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

    – Kusalananda
    Jun 30 at 7:31












  • @Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

    – BlackCrystal
    Jun 30 at 8:13






  • 2





    @BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

    – Kusalananda
    Jun 30 at 8:57


















3















I have two VM machines, and I want them to run a remote command on each other via ssh. I ran these commands on the first machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.148


Then I ran this command and it didn't ask for a password:



[root@fazi1 data1]# ssh root@192.168.254.148 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.7G 893M 6.5G 12% /
tmpfs 1.5G 16K 1.5G 1% /dev/shm
/dev/sda1 194M 41M 144M 22% /boot
/dev/sda2 11G 7.7G 2.4G 77% /data1
/dev/sda7 4.5G 539M 3.8G 13% /data2
/dev/sda5 7.7G 1.4G 6.0G 19% /opt


I ran these commands on the second machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.150


And when I wanted to check if it is working or not:



[root@fazi2 data1]# ssh root@192.168.254.150 df -h
root@192.168.254.150's password:


Why does it work the way I want on the first machine and act different on the second one?



What should I do? (I ran these commands a few times to make sure I didn't enter an incorrect password.)










share|improve this question



















  • 1





    It's usually a permissions problem either on the ~/.ssh directory or one of the files.

    – NickD
    Jun 30 at 5:00






  • 1





    @NickD do you mean the rwx? or a configuration inside files?

    – BlackCrystal
    Jun 30 at 5:11






  • 1





    What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

    – Kusalananda
    Jun 30 at 7:31












  • @Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

    – BlackCrystal
    Jun 30 at 8:13






  • 2





    @BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

    – Kusalananda
    Jun 30 at 8:57














3












3








3








I have two VM machines, and I want them to run a remote command on each other via ssh. I ran these commands on the first machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.148


Then I ran this command and it didn't ask for a password:



[root@fazi1 data1]# ssh root@192.168.254.148 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.7G 893M 6.5G 12% /
tmpfs 1.5G 16K 1.5G 1% /dev/shm
/dev/sda1 194M 41M 144M 22% /boot
/dev/sda2 11G 7.7G 2.4G 77% /data1
/dev/sda7 4.5G 539M 3.8G 13% /data2
/dev/sda5 7.7G 1.4G 6.0G 19% /opt


I ran these commands on the second machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.150


And when I wanted to check if it is working or not:



[root@fazi2 data1]# ssh root@192.168.254.150 df -h
root@192.168.254.150's password:


Why does it work the way I want on the first machine and act different on the second one?



What should I do? (I ran these commands a few times to make sure I didn't enter an incorrect password.)










share|improve this question
















I have two VM machines, and I want them to run a remote command on each other via ssh. I ran these commands on the first machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.148


Then I ran this command and it didn't ask for a password:



[root@fazi1 data1]# ssh root@192.168.254.148 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.7G 893M 6.5G 12% /
tmpfs 1.5G 16K 1.5G 1% /dev/shm
/dev/sda1 194M 41M 144M 22% /boot
/dev/sda2 11G 7.7G 2.4G 77% /data1
/dev/sda7 4.5G 539M 3.8G 13% /data2
/dev/sda5 7.7G 1.4G 6.0G 19% /opt


I ran these commands on the second machine:



ssh-keygen -t rsa
ssh-copy-id 192.168.254.150


And when I wanted to check if it is working or not:



[root@fazi2 data1]# ssh root@192.168.254.150 df -h
root@192.168.254.150's password:


Why does it work the way I want on the first machine and act different on the second one?



What should I do? (I ran these commands a few times to make sure I didn't enter an incorrect password.)







centos ssh command remote






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 30 at 13:58









Peter Mortensen

9426 silver badges9 bronze badges




9426 silver badges9 bronze badges










asked Jun 30 at 4:18









BlackCrystalBlackCrystal

3881 silver badge14 bronze badges




3881 silver badge14 bronze badges







  • 1





    It's usually a permissions problem either on the ~/.ssh directory or one of the files.

    – NickD
    Jun 30 at 5:00






  • 1





    @NickD do you mean the rwx? or a configuration inside files?

    – BlackCrystal
    Jun 30 at 5:11






  • 1





    What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

    – Kusalananda
    Jun 30 at 7:31












  • @Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

    – BlackCrystal
    Jun 30 at 8:13






  • 2





    @BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

    – Kusalananda
    Jun 30 at 8:57













  • 1





    It's usually a permissions problem either on the ~/.ssh directory or one of the files.

    – NickD
    Jun 30 at 5:00






  • 1





    @NickD do you mean the rwx? or a configuration inside files?

    – BlackCrystal
    Jun 30 at 5:11






  • 1





    What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

    – Kusalananda
    Jun 30 at 7:31












  • @Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

    – BlackCrystal
    Jun 30 at 8:13






  • 2





    @BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

    – Kusalananda
    Jun 30 at 8:57








1




1





It's usually a permissions problem either on the ~/.ssh directory or one of the files.

– NickD
Jun 30 at 5:00





It's usually a permissions problem either on the ~/.ssh directory or one of the files.

– NickD
Jun 30 at 5:00




1




1





@NickD do you mean the rwx? or a configuration inside files?

– BlackCrystal
Jun 30 at 5:11





@NickD do you mean the rwx? or a configuration inside files?

– BlackCrystal
Jun 30 at 5:11




1




1





What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

– Kusalananda
Jun 30 at 7:31






What user did you create the keys for on the local system and what user ran ssh-copy-id? There is no indication in the question that this was done by the same user that you're trying to connect as (root). Also, you don't need root to run df -h.

– Kusalananda
Jun 30 at 7:31














@Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

– BlackCrystal
Jun 30 at 8:13





@Kusalananda i ran all the commands by root. that df -h was just for test that i don't need password.i figured out the problem and solve it. i describe the problem in comment in Ulrich answer.

– BlackCrystal
Jun 30 at 8:13




2




2





@BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

– Kusalananda
Jun 30 at 8:57






@BlackCrystal Clarifications to the question should go into the question, not be left in comments that very few people read.

– Kusalananda
Jun 30 at 8:57











1 Answer
1






active

oldest

votes


















4














If I remember correctly, if root login is disabled on .150, i.e. you have



PermitRootLogin no


in /etc/sshd/sshd_config, it will reject all the keys, and possibly fall through to password authentication, if that is in principle allowed. (It will also then reject all passwords, even the correct one.)



Running ssh -vvv root@192.168.254.150 false will give you a pretty verbose output of what might go wrong. You'll see lines for your keys in /root/.ssh/id_rsa etc., and you can see if your client is offering them to the server, and if the server likes them. If you're not offering, it's likely a permission problem on the client side, if the server is rejecting them, they're either not in authorized_keys on the remote side (but ssh-copy-id should have given you an error then, or the server doesn't permit root logins.






share|improve this answer


















  • 1





    the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

    – BlackCrystal
    Jun 30 at 7:29













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f527698%2fcan-not-ssh-to-server-without-a-password%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














If I remember correctly, if root login is disabled on .150, i.e. you have



PermitRootLogin no


in /etc/sshd/sshd_config, it will reject all the keys, and possibly fall through to password authentication, if that is in principle allowed. (It will also then reject all passwords, even the correct one.)



Running ssh -vvv root@192.168.254.150 false will give you a pretty verbose output of what might go wrong. You'll see lines for your keys in /root/.ssh/id_rsa etc., and you can see if your client is offering them to the server, and if the server likes them. If you're not offering, it's likely a permission problem on the client side, if the server is rejecting them, they're either not in authorized_keys on the remote side (but ssh-copy-id should have given you an error then, or the server doesn't permit root logins.






share|improve this answer


















  • 1





    the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

    – BlackCrystal
    Jun 30 at 7:29















4














If I remember correctly, if root login is disabled on .150, i.e. you have



PermitRootLogin no


in /etc/sshd/sshd_config, it will reject all the keys, and possibly fall through to password authentication, if that is in principle allowed. (It will also then reject all passwords, even the correct one.)



Running ssh -vvv root@192.168.254.150 false will give you a pretty verbose output of what might go wrong. You'll see lines for your keys in /root/.ssh/id_rsa etc., and you can see if your client is offering them to the server, and if the server likes them. If you're not offering, it's likely a permission problem on the client side, if the server is rejecting them, they're either not in authorized_keys on the remote side (but ssh-copy-id should have given you an error then, or the server doesn't permit root logins.






share|improve this answer


















  • 1





    the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

    – BlackCrystal
    Jun 30 at 7:29













4












4








4







If I remember correctly, if root login is disabled on .150, i.e. you have



PermitRootLogin no


in /etc/sshd/sshd_config, it will reject all the keys, and possibly fall through to password authentication, if that is in principle allowed. (It will also then reject all passwords, even the correct one.)



Running ssh -vvv root@192.168.254.150 false will give you a pretty verbose output of what might go wrong. You'll see lines for your keys in /root/.ssh/id_rsa etc., and you can see if your client is offering them to the server, and if the server likes them. If you're not offering, it's likely a permission problem on the client side, if the server is rejecting them, they're either not in authorized_keys on the remote side (but ssh-copy-id should have given you an error then, or the server doesn't permit root logins.






share|improve this answer













If I remember correctly, if root login is disabled on .150, i.e. you have



PermitRootLogin no


in /etc/sshd/sshd_config, it will reject all the keys, and possibly fall through to password authentication, if that is in principle allowed. (It will also then reject all passwords, even the correct one.)



Running ssh -vvv root@192.168.254.150 false will give you a pretty verbose output of what might go wrong. You'll see lines for your keys in /root/.ssh/id_rsa etc., and you can see if your client is offering them to the server, and if the server likes them. If you're not offering, it's likely a permission problem on the client side, if the server is rejecting them, they're either not in authorized_keys on the remote side (but ssh-copy-id should have given you an error then, or the server doesn't permit root logins.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 30 at 6:52









Ulrich SchwarzUlrich Schwarz

10.6k1 gold badge32 silver badges49 bronze badges




10.6k1 gold badge32 silver badges49 bronze badges







  • 1





    the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

    – BlackCrystal
    Jun 30 at 7:29












  • 1





    the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

    – BlackCrystal
    Jun 30 at 7:29







1




1





the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

– BlackCrystal
Jun 30 at 7:29





the PermitRootLogin was yes and -vvv didn't show anything useful. but i finally found the problem. both root passwords on both servers were same. i changed them into something different from each other, it worked. i don't know the reason btw.

– BlackCrystal
Jun 30 at 7:29

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f527698%2fcan-not-ssh-to-server-without-a-password%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림