-bash: /var/lib/rancid/.bash_profile: Permission denied bash command not found - bash

-bash: /var/lib/rancid/.bash_profile: Permission denied bash command not found
I am trying to switch between the users ( krypton & rancid) in ubuntu 16.04 with
su - . A few days back it worked perfectly, but don't know what happened now. The above warning message is coming.
When I am working as krypton user ~$ is showing
But when I am trying to switch to rancid using su - rancid, the above error is coming and entering into the user with /$ at the beginning. I am not able to run some commands and it's interrupting me.
Please give me a solution. I am wasting all my time with this.

First, check the permission of your /var/lib/rancid/.bash_profile file, and all parent folder. You can ls -ld them each, and put output here.
Then, you may check what there is in your ~/.bashrc file.

Related

I keep getting this error when I try to drive my contract with the scripts

I'm trying to use the scripts from the 'Learn-NEAR/starter--near-sdk-as' to drive my own contract but I keep getting this bash error:
Which account did you authorize for use with NEAR CLI?
Enter it here (if not redirected automatically):
Logged in as [ melchizedek.testnet ] with public key [ ed25519:BmiLAN... ] successfully
gitpod /workspace/MyAssemblyContract (main) $ ./scripts/1.dev-deploy.sh
bash: ./scripts/1.dev-deploy.sh: Permission denied
gitpod /workspace/MyAssemblyContract (main) $
Everything else was working fine up to this point.
Finally found the issue: I didn't have execution privileges to that file.
Funny because I had execution privileges to all the other files except this one.
Fixed it using
chmod u+x 1.dev-deploy.sh

VS Code Will Not Save Changes - Mac

I know this question has been asked before, but none of the advised solutions have worked for me. I am on a Mac and trying to save changes to a VS Code file. When I press save, it says
Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
When I choose to "Retry as Sudo" I enter my password and it says
Failed to save... Error using --file-write: EPERM: operation not permitted
I have tried a couple of different things to open VS Code with admin privileges, including running it from the terminal with the command:
sudo open /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron
and manually adding VS Code to my path using the commands
cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF
I have yet to find anything that affects the failed to save error, and if anyone has any suggestions, they would be greatly appreciated!
05-03-2021
This works for me.
Sudo chown –R username folder-path
e.g
sudo chown -R sampath /Users/sampath/Desktop/Test/renoTracker/platforms/ios
Its no longer an issue after running:
$ sudo chown -R username .
Hope this will resolve all kind of permission issues.
I have fixed my issue by adding user here in permission. May be this can solve your issue

Centos 7 errors on each command

Abruptedly when I execute any command on my Centros 7 shell I receive errors hampering their executions. Errors are of the kind:
$ ls
-bash: /usr/bin/ls: Input/output error
$ df
-bash: df: command not found
$ top
-bash: /usr/bin/top: Input/output error
I tried rebotting the machine to no avail and no service like fsftp or http work. Please help me as soon as possible as that is the main server of my backoffice.
It was an issue on the provider, Crissic, one notified and acknowledged the issue it took a day to fix it.

Cannot clone an aegir site

I am getting this error while cloning the site on aegir
Unknown option: --profile. See drush help provision-backup for available >options. To suppress this error, add the option --strict=0. [2.39 sec, 21.19 MB]
I am using aegir3 on ubuntu 14.04.4. Can anyone please help me solve this. I have searched on web but there is no solution regarding this issue. This issue also occurs while migrating.
you might find more Aegir users at the new community support forum
http://ask.aegir.support/
I had a similar issue and found a solution there
I found that debugging Aegir issues was a lot easier if you executed the Drush commands directly.
You can find the command by looking through the Log Messages keeping an eye out for entries like
Backend invoke: /usr/bin/php -d magic_quotes_gpc=Off -d magic_quotes_runti... (Expand)
Below entries like the above you will find the command that was executed, expand that by clicking the (Expand) and copy the command (I found sometimes the expand did not work, in cases like this I just use chrome tools to look at the source and copy it)
/usr/bin/php -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off /var/aegir/.composer/vendor/drush/drush/drush.php --php=/usr/bin/php --php-options=' -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off' --backend=2 --yes #centosintranet provision-install-backend --client_email='this.email#is.invalid' 2>&1
All you need to do now is run this as the Aegir user via bash. If you use the apt-get package to install Aegir you should be able to open a terminal and enter
sudo su - aegir -s /bin/bash
You will be prompted for your password, after entering it you will have a bash shell as the Aegir user. Paste in the above drush command and press enter.
Watch it execute, I found it easier to work out what was going on by removing the --backend=2 option. If you still can't see what the issue is try adding -vvv or --debug to the drush command.
Using this method I have solves all issues I have run into thus far when Aegir falls over.

Stuck with bash not loaded after chmod -rwx mistake on /usr/

I am new to debian (on a Raspberry Pi), and it comes with mistakes...
Trying to give chmod permissions over the /usr/ files to my login (pi), I made a mistake, confusing "-" with "+". I executed the commande line :
$ sudo chmod -rwx /usr pi
wich gets me in a bad situation :
I cannot execute anythong anymore because bash won't load.
After reboot, and logged as pi, same issue with this errors :
ERROR: ld.so: object '/usr/lib/arm-linux-gnuabihf/libcofi_rpi.so' from /etc/ld.so.preload cannot be preloaded: ignored
- bash: id: command not found
- bash: [: : integer expression expected
- bash: /usr/share/bash-completion/bash_completion: Permission denied
pi#raspberrypi:~$
and from there, my attemps to give chmod permissions to /usr/ are useless, because I don't have permissions at all...
most commands dont't work (startx, or else), as I get an error :
- bash: startx: command not found
How can I get out of that situation without restarting from scratch ?
Thanks a lot for your help !
Update
I actually found a list with many username/password combinations for different distributions often used on Raspberry. So check first, if your distribution is in there (I guess either Debian or Raspbian) and try the passwords there at the login prompt. If they do not work on SSH, try them directly (root login via SSH could be disabled).
Old entry
The Debian distribution for raspberry does not seem to have a password for root set by default. Thus, you cannot login as root. I guess, due to the access changes you cannot execute sudo?
So, the whole problem has to be solved from another operating system: Insert the SD card into another PC. If you do not have linux, you can boot it with a live CD like Ubuntu or Knoppix.
From there you can mount the SD card:
mount /dev/sdX? /mnt
sudo chmod 0755 /mnt/usr
Here X is variable and you have to find it out. Best is, you insert the SD card after the whole system has booted. Then the SD card should have the highest letter (e.g. d, if you have three other harddisks in your PC). The question mark ? has to be replaced with a number (probably 1).
You will have to log in as root. so that you can ignore the permissions you have set, and then run:
chmod 0755 /usr

Resources