LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-21-2019, 10:28 AM   #1
homer_3
Member
 
Registered: May 2008
Posts: 99

Rep: Reputation: 15
When sourcing .profile i get "/usr/bin//.: Permission denied."


I've commented out my entire ~/.profile and still get this permission denied error when I try to source it.

ls -l gives

-rwxrwxrwx. 1 <myname> users 288 May 21 09:20 /home/<myname>/.profile

groups shows I'm in the users group. Why can't I source my profile?
 
Old 05-21-2019, 10:55 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by homer_3 View Post
I've commented out my entire ~/.profile and still get this permission denied error when I try to source it.

ls -l gives

-rwxrwxrwx. 1 <myname> users 288 May 21 09:20 /home/<myname>/.profile

groups shows I'm in the users group. Why can't I source my profile?
May be I am misunderstanding here? But, you need to use:

Code:
source ~/.profile
So, add the word source before ~/.profile
 
Old 05-21-2019, 11:00 AM   #3
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by homer_3 View Post
I've commented out my entire ~/.profile and still get this permission denied error when I try to source it.

ls -l gives
But what does "ls -dl /usr/bin" return?
It should give an output something like this:
Code:
 $ ls -dl /usr/bin
drwxr-xr-x 3 root root 77824 2019-04-26 05:53 /usr/bin
that is: readable and searchable (x) for everyone.
 
Old 05-21-2019, 11:27 AM   #4
homer_3
Member
 
Registered: May 2008
Posts: 99

Original Poster
Rep: Reputation: 15
ls -dl /usr/bin gives

dr-xr-xr-x. 2 root root 86016 Apr 24 09:58 /usr/bin

@dc.901 I've tried both source ~/.profile and . ~/.profile.
 
Old 05-21-2019, 12:20 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by homer_3 View Post
I've commented out my entire ~/.profile and still get this permission denied error when I try to source it.

ls -l gives

-rwxrwxrwx. 1 <myname> users 288 May 21 09:20 /home/<myname>/.profile

groups shows I'm in the users group. Why can't I source my profile?
By "commented out" do you mean that you've commented every line in the .profile script? Why? To try to eliminate the error?
Is there a line containing
Code:
/usr/bin//
?? Note the double '/' (Which shouldn't matter)
Please paste the error message between [code] [/code] tags, which will preserve exactly what it says. Please use [code] tags for all pasted output, for clarity.
Whats in /etc/profile?

Probably not a good idea to have ~/.profile be group and world writable (chmod 777) Should only be writable by the owner (chmod 644), and need not be executable at all to be sourced.

I'm running CentOS 7 and using bash...I don't even have a .profile -- bash uses .bash_profile
Code:
-rw-r--r--.  1 scasey scasey    193 Jan 24 12:30 .bash_profile
 
Old 05-21-2019, 12:30 PM   #6
homer_3
Member
 
Registered: May 2008
Posts: 99

Original Poster
Rep: Reputation: 15
Yes, I commented out every line to remove the possibility of the issue being something within the file.

The error in code tags is

Code:
/usr/bin//.: Permission denied.
I had 777'd it to see if that would fix the permission error.
 
Old 05-21-2019, 12:44 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by homer_3 View Post
Yes, I commented out every line to remove the possibility of the issue being something within the file.

The error in code tags is

Code:
/usr/bin//.: Permission denied.
I had 777'd it to see if that would fix the permission error.
Well, the permission error is not reporting .profile, and it didn't fix it, so you should change that back to what it was.
You should put the lines back too, since that didn't fix it either.

That path is very strange. The double / shouldn't matter, but where's the dot (.) coming from?
Where is /usr/bin<anything> used in .profile?
What shell are you using?
Again, what's in /etc/profile? Have you modified it? Or any of the files in /etc/profile.d?

Last edited by scasey; 05-21-2019 at 12:49 PM.
 
Old 05-21-2019, 12:58 PM   #8
homer_3
Member
 
Registered: May 2008
Posts: 99

Original Poster
Rep: Reputation: 15
Quote:
Where is /usr/bin<anything> used in .profile?
Nowhere, which is why this error is so weird to me.

Quote:
What shell are you using?
echo $0 gives

Code:
/usr/local/bin/tcsh
So I guess I should be using ~/.tcshrc instead of .profile. Though I thought I should be able to source any text file.

/etc/profile is a large script file which hasn't been edited, which is installed with the OS, isn't it?
 
Old 05-21-2019, 02:59 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by homer_3 View Post
Nowhere, which is why this error is so weird to me.


echo $0 gives

Code:
/usr/local/bin/tcsh
So I guess I should be using ~/.tcshrc instead of .profile. Though I thought I should be able to source any text file.

/etc/profile is a large script file which hasn't been edited, which is installed with the OS, isn't it?
Yes, and if it hasn't been edited that's good. I think it's sourced in .profile -- maybe -- as I said, I don't have a .profile

Is the error causing any problems?
Can you run commands that are in /usr/bin ?
Do you get the error when you first login, or only when trying to source the file?
 
Old 05-21-2019, 04:05 PM   #10
homer_3
Member
 
Registered: May 2008
Posts: 99

Original Poster
Rep: Reputation: 15
Well I guess it's not causing problems anymore now that I realized I should be editing the .tcshrc file.
 
Old 05-22-2019, 02:46 AM   #11
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,789

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
csh/tcsh is much different from sh/bash/ksh/zsh.
The latter read .profile at a system login.
csh/tcsh read .cshrc (tcsh takes .tcshrc instead if it exists), and then .login if it is a login shell (at a system login).
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] apparmor="DENIED" operation="rename_src" profile="/usr/bin/freshclam Toadman Linux - Software 4 06-27-2018 08:52 AM
Just Curious: why do "/usr/bin/test" and "/usr/bin/[" have different sizes? DaneM Programming 5 01-06-2014 03:33 AM
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 05:31 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:22 PM.

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
Open Source Consulting | Domain Registration