Ssh failing due to Bad owner error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ssh failing due to Bad owner error
# 1  
Old 11-09-2016
Bug Ssh failing due to Bad owner error

i am logged in with "user1" on host1.

I m trying to ssh to host2 using user id "user2"

Code:
[user1@host1 apache]$ ssh user2@host2
Bad owner or permissions on /home/user1/.ssh/config

Question 1: Can you please tell me why am i getting the Bad owner permissions error on that directory ?

Question 2: Where is it looking for the "Bad owner or permissions on /home/user1/.ssh/config" on host1 or host2 ?

Note: I do not have root privileges.

Regards,
# 2  
Old 11-09-2016
It is for host1. Try executing below command helps,
Code:
chmod 600 /home/user1/.ssh/config

# 3  
Old 11-09-2016
Quote:
Originally Posted by greet_sed
It is for host1. Try executing below command helps,
Code:
chmod 600 /home/user1/.ssh/config

I tried 775 and it still have the same error. Do you still want me to give permission 600 ? If yes, why? Can you make me understand why 600 and not 775 would help?
# 4  
Old 11-10-2016
I think it is due to, too open permissions. With
Code:
 chmod 600

giving permission to root only here . Similarly you have to give permission to correct user if user1 is not root. ( I see that now )
# 5  
Old 11-10-2016
reading (and understanding) man ssh occasionally helps:
Quote:
FILES
.
.
.
~/.ssh/config
This is the per-user configuration file. The file format and configuration options are described in ssh_config(5). Because of the potential for abuse, this file must have strict permissions: read/write for the user, and not writable by others. It may be group-writable provided that the group in question contains only the user.
# 6  
Old 11-10-2016
You need to keep the files owned by the specific user and private. It's not a "I can't read it" but really an "other people can read it" complaint. By design, ssh want to keep things secure so only the specific user is allowed to see the file.

Check that everything including ~/.ssh and below are owned by user1 and are access to the owner only, so permissions 700 for the directory and 600 for the files.



Robin
# 7  
Old 11-10-2016
Quote:
Originally Posted by mohtashims
I tried 775 and it still have the same error.
Precisely because of that.

Quote:
Originally Posted by mohtashims
Do you still want me to give permission 600 ?
In fact, you can do whatever you want, but the error won't go away otherwise.

Quote:
Originally Posted by mohtashims
If yes, why? Can you make me understand why 600 and not 775 would help?
As you have been told: because the man page says so. But there is a deeper reason: ssh (and the underlying OpenSSL library) are built by people trying to achieve a certain goal and this goal is: security. If you do something which would compromise this goal ssh/OpenSSL will try to stop you from doing that - in this case by issuing an error.

If you make the directory where (supposedly) your private keys are stored readable and searchable for a whole group ("775" means everybody can read there and members of your group can even write there) who, do you think, will stop members of your group to just change your private keys to some arbitrary value if they feel like it. (If you think "trust" is a good concept in IT security: just connect your main server to the internet and post the root password to Facebook - we'll see what happens and how fast.)

I have said it already and i wll say it again: the UNIX way in general is not turning off what is an absolute obstacle but turning on only what one really needs.

If you need only filemode 600 why whould you even want to set 775 in first place, even if it would work? Apart from your unwillingness to consult man pages, reluctance to come to an understanding of concepts and resistance to take advice by heart - you seriously need to work on your "work ethics" too: more doesn't always help more (in fact sometimes it helps less) and for the same reason filemode 777 is not the fix for everything.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ssh fails due to argument position.

I have a constraint to follow organization policy. So i do not have much liberty. ssh -i /opt/nonprod user1@hostone -t bash works while ssh -i /opt/nonprod -t bash user1@hostone fails How can I get this to work when I am enforced to put -t bash before the user@hostname ? Will share debug... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. Shell Programming and Scripting

SSH is failing due to unknown reason

Hi, I have setup keys between user1@server1 and user2@server2 however, the ssh is failing. server1 is Linux 3.10.0-514.6.2.el7.x86_64 #1 SMP whereas server2 is 5.10 Generic_150400-40 sun4v sparc sun4v I have checked port 22 to be open and keys to be correct. I also find the permissions... (3 Replies)
Discussion started by: mohtashims
3 Replies

3. UNIX for Advanced & Expert Users

OEL 6.3 :Slow login due to /etc/ssh/sshd_config configuration

Version: Oracle Enterprise Linux 6.3 Running on VMWare Workstation When I login to my Linux VM from putty, the third line prompting for password comes only after few seconds. login as: root Access denied root@192.168.0.235's password: ---> It takes around 5 seconds to get this prompt I... (1 Reply)
Discussion started by: John K
1 Replies

4. UNIX for Advanced & Expert Users

SSH public key failing without error message

My password-free ssh connection has worked in the past but has stopped working and I can't get it going again. The files in .ssh on both source and target are set to 600: drwx------ 2 ingres 1024 Mar 2 13:57 . drwxr-xr-x 25 ingres 2048 Mar 29 09:38 .. -rw------- 1 ingres ... (9 Replies)
Discussion started by: Catullus
9 Replies

5. Solaris

zip -r <directory> failing due to 2GB limit - Just asking opinion

Hi, Am trying to run zip -r on a 2.4G directory and it is failing with the error below. I believe this is because of the 2G limit of the zip program. server101(oper01)/u01/temp$: date Thu Mar 15 12:53:44 NZDT 2012 server101(oper01)/u01/temp$: ls -l total 8 drwxr-x--x 4 oracle dba ... (1 Reply)
Discussion started by: newbie_01
1 Replies

6. Shell Programming and Scripting

how do i avoid system hang due to ssh in script?

I have a script that collects data from about 200 servers using 'ssh'. The problem is that, process sometime hangs at some point stopping the execution of the script. Please give me some idea how can I force the execution to jump to the next step if there arises any problem !! Thanks for replies if... (1 Reply)
Discussion started by: mdangol
1 Replies

7. Shell Programming and Scripting

Writing to file failing (maybe due to lock?)

Driver script kicks off supporter scripts in background. The supporter script writes it's own PID ($$) into a status file. When script completes, deletes the PID from the status file. The driver script constantly polls this status file for number of lines. As and when it's get lower than XX... (2 Replies)
Discussion started by: baivab
2 Replies

8. Solaris

Owner of file gets 'not owner' error for chgrp

Hi Folks, I know that changing users and groups is pretty basic admin, but this one has got me stumped. When I try to change the group of a file for which I am the owner for, it still gives me a 'Not owner' error. For example, when I am logged in as 'webadmin', I have the following file: ... (4 Replies)
Discussion started by: brizrobbo
4 Replies

9. Shell Programming and Scripting

IF condition failing in a SSH script

Hi, I'm ssh-in to a remote machine (ubuntu) and trying to execute a little script in there.The script looks like this: ssh user@ubuntu <<EOF cd ~/test ls -l echo "Continue counting files starting with a`s ?" read answer if then ls -l a* else exit fi EOF Now everything works... (9 Replies)
Discussion started by: rubionis
9 Replies

10. Shell Programming and Scripting

ssh - rm failing

Hi, Please help me... I am creating a string of filenames with absolute path and deleting those files situated in the remote server using ssh .. but it doesnot work.. Can anyone help me... here is my code for FileName in ${myDire} do Tmp=`basename... (4 Replies)
Discussion started by: shihabvk
4 Replies
Login or Register to Ask a Question