LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   SSH problem (https://www.linuxquestions.org/questions/linux-security-4/ssh-problem-161450/)

pixie 03-23-2004 01:54 PM

SSH problem
 
Hi,
I screwed up the permissions on the /etc dir, and now other users can't login through ssh, only root can login. Any sugestions please?

trickykid 03-23-2004 02:12 PM

Well what did you change and have you tried to revert back? Can you post your config files here or permissions, etc? More details, we can't guess what you did to mess things up... ;)

pixie 03-23-2004 02:35 PM

Quote:

Originally posted by trickykid
Well what did you change and have you tried to revert back? Can you post your config files here or permissions, etc? More details, we can't guess what you did to mess things up... ;)
I changed the permissions on the /etc folder so only root could read write alter etc, and also aplied that to all sub dir and files. (what it was before can't rem) That caused loads of problems, so i then changed it all back so root and group could read write alter etc. That of course made things worse, the ssh server shut down for security violations (obviously) and a few other errors. By trial and error, i have managed to get most things working again except that only root can now use ssh. I even tried setting up a new user, but newuser can't use ssh either. I guess i need to know the correct permissions for ssh, pam, and anything else thats involved. A bloody mess eh?
/me/looks for an embarassed smilie

unSpawn 03-23-2004 03:52 PM

Warning: running this will reset ALL permissions. It depends on having an rpm database (hope I guessed right you're using Mandy): "rpm --setperms -qa". If you are running Aide you could do:
"zcat aide.db|egrep -ve "^(#|@)"|while read l; do l=( ${l} )
chmod ${l[2]} ${l[0]}; chown ${l[4]}:${l[5]} ${l[0]}; done"
but note this will barf on spaces in names.
In other cases you hope perms are stored and can be retrieved from whatever your package/backup manager provides or you'll have to restore from cdr/mirror.

pixie 03-23-2004 04:17 PM

Quote:

Originally posted by unSpawn
[B]Warning: running this will reset ALL permissions. It depends on having an rpm database (hope I guessed right you're using Mandy): "rpm --setperms -qa".
HI,
thanks for the reply. I'm using redhat 8.00 on a server actually, i believe Mandy was MDK-9.2.
So, rpm --setperms -qa will reset them to before i made changes, or when all the RPMs were installed?

unSpawn 03-23-2004 05:18 PM

"rpm --setperms -qa" takes it's input from the rpm database, so AFAIK this means perms from initial install.

pixie 03-24-2004 05:00 AM

It worked a treat!
Thanks very much for your help.


All times are GMT -5. The time now is 07:28 PM.