LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-23-2004, 01:54 PM   #1
pixie
Member
 
Registered: Aug 2003
Distribution: Mageia, Centos, CloudLinux
Posts: 53

Rep: Reputation: 27
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?
 
Old 03-23-2004, 02:12 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 245Reputation: 245Reputation: 245
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...
 
Old 03-23-2004, 02:35 PM   #3
pixie
Member
 
Registered: Aug 2003
Distribution: Mageia, Centos, CloudLinux
Posts: 53

Original Poster
Rep: Reputation: 27
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
 
Old 03-23-2004, 03:52 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,383
Blog Entries: 55

Rep: Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558
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.
 
Old 03-23-2004, 04:17 PM   #5
pixie
Member
 
Registered: Aug 2003
Distribution: Mageia, Centos, CloudLinux
Posts: 53

Original Poster
Rep: Reputation: 27
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?

Last edited by pixie; 03-23-2004 at 04:18 PM.
 
Old 03-23-2004, 05:18 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,383
Blog Entries: 55

Rep: Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558
"rpm --setperms -qa" takes it's input from the rpm database, so AFAIK this means perms from initial install.
 
Old 03-24-2004, 05:00 AM   #7
pixie
Member
 
Registered: Aug 2003
Distribution: Mageia, Centos, CloudLinux
Posts: 53

Original Poster
Rep: Reputation: 27
It worked a treat!
Thanks very much for your help.
 
  


Reply


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
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
ssh problem Mystified Linux - Networking 5 01-23-2005 06:17 PM
problem with ssh ito Linux - Networking 6 08-25-2003 04:21 PM
ssh problem juanb Linux - Security 6 08-21-2003 02:58 PM
ssh and X problem mazzo Linux - Networking 7 08-14-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration