Solved

File Permissions

Posted on 2006-06-15
16
690 Views
Last Modified: 2013-12-16
I changed file permissions on some of the directories in / and now my email does not work.  The files are on a remote server running Red Hat Linux ES 3 and I can't login to using Putty either.  I can logon using Webmin.

Help!  I'm new to linux and was trying to close up permissions for ftp.

Thanks,

mwclassen
0
Comment
Question by:mwclassen
  • 7
  • 7
  • 2
16 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 16913121
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16913147
For a default RHEL3 server, the file and directory settings for / should be:

------------------8X----------------------------
[root@bigserver root]# ls -al /
total 281
drwxr-xr-x   21 root     root         4096 Jun 14 22:30 .
drwxr-xr-x   21 root     root         4096 Jun 14 22:30 ..
-rw-------    1 root     root        15360 Jun 14 22:31 aquota.group
-rw-------    1 root     root        16384 Jun 14 22:31 aquota.user
-rw-r--r--    1 root     root            0 Jun 14 22:30 .autofsck
drwxr-xr-x    2 root     root         4096 Jun  8 20:01 bin
drwxr-xr-x    4 root     root         1024 Apr 26 19:32 boot
drwxr-xr-x   22 root     root       118784 Jun 14 22:31 dev
drwxr-xr-x   71 root     root         8192 Jun 14 22:31 etc
-rw-r--r--    1 root     root           51 Oct 15  2005 .fonts.cache-1
drwxr-xr-x    7 root     root         4096 May 28 17:04 home
drwxr-xr-x    2 root     root         4096 Dec 14  2003 initrd
drwxr-xr-x   12 root     root         4096 Jun  1 11:03 lib
drwx------    2 root     root        16384 Oct 15  2005 lost+found
drwxr-xr-x    2 root     root         4096 Dec 12  2003 misc
drwxr-xr-x    5 root     root         4096 Apr 17 11:49 mnt
drwxr-xr-x   12 root     root         4096 Apr  3 05:12 nsr
drwxr-xr-x    5 root     root         4096 Apr 17 19:29 opt
dr-xr-xr-x   77 root     root            0 Jun 14 23:30 proc
drwxr-x---   62 root     root         8192 Jun 14 23:19 root
drwxr-xr-x    2 root     root         8192 May 18 10:31 sbin
drwxr-xr-x    2 root     root         4096 Feb 28 21:18 tftpboot
drwxrwxrwt   29 root     root        32768 Jun 15 04:02 tmp
drwxr-xr-x   19 root     root         4096 Jun  1 16:52 usr
drwxr-xr-x   23 root     root         4096 Jun  8 20:04 var
------------------8X----------------------------


0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16913240
Unfortunately, your question is not very good. It is extremely difficult to answer, because it is so vague and very broad with respect to 'everything' not working. Also the amount of information you have provided makes it virtually impossible to offer constructive help. In future try and assign 1 question to 1 problem.

Putty:

1.    Can you telnet to port 22:

telnet servername.com 22

If you get something like:

Connected to servername.com (ww.xx.yy.zz).
Escape character is '^]'.
SSH-2.0-OpenSSH_3.6.1p2

then the sshd is working fine. The next bit is the login process. Check /var/log/secure

If the login password is given as correct, then you need to look at the file permissions for the home directory.

Leave the ftp alone, until you've got everything else working (including mail and putty). If you are asking for help on configuration you need to give much more information. e.g:

Problem with email - what MTA are you using (sendmail, xmail, qmail postfix, exim etc) Symptoms, Any specific information from the config file that might be important, log extracts, and any recent events that might have a bearing.

Similarly with ftp. Obviously if you don't know where to find some of the suggested info, at least give the name of teh ftp server software that you are using, so that people can provide you with information as to where to look if necssary.

HTH:)
0
 

Author Comment

by:mwclassen
ID: 16913302
Sorry about the question.

I working as fast as I can with the info you are providing and it it exactly what I was looking for.  I'll let you know when things start working again.

Thanks,
mwclassen
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16913379
No need to be sorry - We all have to start somewhere - consider the information as advice. Also try and look at the problem from our perspective. We are all volunteers, and if the question is poor, you can guess what mmost of us will do. Also, the more accurate the question, then the more precise we can be with the answer.

As an aside, I thought I'd add some mail trouble shooting tips.

Not receiving mail?...then try and see if you can connect to the server via the appropriate port (Normally 110 for POP, POP3 or 143 for IMAP)

Look here for info:

http://manual.liquidweb.com/chapter3/pop3.htm

Not able to send mail...then similarly:

http://www.pantz.org/email/misc/smtptelnet.shtml


Looks like you'll be able to fault-find almost anything with telnet by the end of this:)
HTH:)
0
 

Author Comment

by:mwclassen
ID: 16913649
I pretty sure that it is a permissions issue as that was all that change when things started falling apart.  I have not been able to telnet which makes me very handicapped as I am use to Putty and WinSCP to manage files.  Both are refused connections.  Webmin has a file manament module that is, in my opinion, a real pain to use.  When I tried to start the ssh server from Webmin, I received error messages that told me permissions were to open.  I closed up permissions per the suggestions until it quit giving errors, but it still does not appear to be starting.

mwclassen

0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16914454
Read the instructions!

You are telnetting to connect to the port that is used for Putty (ssh) or mail functions (POP and SMTP).

This is used to help you understand how it works, and diagnose what is wrong. The above are 'tests' that will enable you to get putty and mail working again. You should never (from a security perspective) use telnet for remote connections if putty is available and will carry out the same task.

The whole point of the telnet commands is that they tell you how the port is functioning - is it possible to connect to it, is it responding correctly and are there any firewall issues.

Read the links I gave you and you'll start to understand that this is a very useful method of testing.
0
 

Author Comment

by:mwclassen
ID: 16915593
I can telnet into our POP3 account and receive back good info per the instructions above.  When I try to telnet into port 22 I get   "Could not open connection to the host, on port 22: Connect failed"

Back on the linux server I cannot stop and start the ssh service successfully.  We are using MailScanner for email and that service I cannot stop and start successfully either.

Just an update on the issue.

mwclassen
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 22

Expert Comment

by:pjedmond
ID: 16915937
"Could not open connection to the host, on port 22: Connect failed"

That probably means that sshd is not started.

Why can'y you start sshd from within your webmin control panel? You are aware that webmin also provides the ability to run 'shell' commands under the Others tab, Shell?

So you could test whether sshd is running by typing:

service sshd status

Should give you a pid...if not:

service sshd start

..and then retry connecting to port 22 - If it works, try ssh to port 22.



0
 

Author Comment

by:mwclassen
ID: 16923228
I am wading through programs checking file and directory permissions.  Webmin shows me all the programs and their file status.  Quit a few have failed permission checks and then shows what they are to be set as.  As I make the changes the status shows OK.  It's just taking time.

Another update.

Thanks,
mwclassen
0
 

Author Comment

by:mwclassen
ID: 16923240
pjedmond,

I did try the last suggestion to restart sshd and still cannot connect:(

mwclassen
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 400 total points
ID: 16924530
You need to provide more information with this type of problem. In general , if you get a list of things to try, you should give as much information as possible about the response of the system to that process. In particular, what was the response to:

service sshd status

service sshd start

After attempting the above commands, the output of:

cat /var/log/secure

is of interest. You are looking for a line along the lines of:

Server listening on 0.0.0.0 port 22

*or* a whole load of errors...which should tell us what to fix:)

Output of:

ps -ef | grep ssh

will tell me whether any sshd is running.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16930353
> .. Putty and WinSCP to manage files.  Both are refused connections.
this has nothing to do with file permissions

> .. restart sshd and still cannot connect:(
please post result of following command:
  netstat -pan|grep ssh
0
 

Author Comment

by:mwclassen
ID: 16935048
Here's the output that I was able to generate using Webmin's command line.  Part of the time it seems to work and part not.

> service sshd status
sshd is stopped

service sshd start
Executing /etc/rc.d/init.d/sshd start ..
Starting sshd:[  OK  ]

>/var/log/secure entries
Jun 19 10:03:27 argosy sshd[2927]: error: Bind to port 22 on xx.xxx.xxx.xxx failed: Cannot assign requested address.
Jun 19 10:03:27 argosy sshd[2927]: fatal: Cannot bind any address.

> ps -ef | grep ssh     (this command was run after the above)
root      3310  3307  0 10:08 ?        00:00:00 su root -c ps -ef | grep ssh
root      3311  3310  0 10:08 ?        00:00:00 bash -c ps -ef | grep ssh

>netstat -pan | grep ssh
Webmin returned repeatedly "Page cannot be displayed"  Sorry:(

Just a reminder that the server in question is remote and Webmin is my only access at the moment.

mwclassen
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 100 total points
ID: 16935073
> Jun 19 10:03:27 argosy sshd[2927]: error: Bind to port 22 on xx.xxx.xxx.xxx failed: Cannot assign requested address.
sounds like a misconfigured sshd, please check yur configuration, in particular the IP
0
 

Author Comment

by:mwclassen
ID: 16935552
You guys are right!  The ssh problem had nothing to do with permissions.  I've never had ssh problems and the server has been running with no issues for over 6 weeks so I was sure that the permissions changes that I made right before the crash was causing all the problems.  The problem turned out to be an address that I had left in the config file from some testing a few weeks back.  Obviously, I didn't have a need to restart the ssh server or do a reboot until now.

ssh works fine now, and email is working.  I still have some permission issues to clean up, but with these two issues resolved, this question has been answered.

Thanks for the help,

mwclassen
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now