≡ Menu

chmod command

How to copy permissions from one file to another on Linux

I need to copy or clone file ownership and permissions from another file on Linux. Is there a bash command line option to clone the user, group ownership and permissions on a file from another file on Linux operating system?
[click to continue…]

Bash: .* Considered Harmful To Match Dot Files. Why?

How do I match dot files under Unix / Linux using bash shell? Why .* considered as harmful when matching dot files under bash shell?
[click to continue…]

SSH: WARNING: UNPROTECTED PRIVATE KEY FILE! Error and Solution

I‘m setting up server on an Amazon EC2 compute instance powered by Suse Enterprise Linux server. I am using the following command to login into the my EC2 compute from OS X/Ubuntu desktop:

ssh -i suse-ec2-server-jp.pem root@ec2-xx-yy-zzz-yyy.compute-1.amazonaws.com

I am getting the following error:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0440 for 'suse-ec2-server-jp.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: suse-ec2-server-jp.pem
Password:

How do I fix this problem and login using ssh command?
[click to continue…]

Linux Gnome: gconf-sanity-check-2 Exited With Status 256 Error and Solution

When I try to login into my Linux Gnome based desktop system, I get the following error from GDM :

gconf-sanity-check-2 exited with status 256

How do I fix this problem?
[click to continue…]

How To Set Readonly File Permissions On Linux / Unix Web Server DocumentRoot

How do I set a read-only permission for all of my files stored in /var/www/html/ directory?
[click to continue…]

Could not chdir to home directory /root: No such file or directory Error and Solution

When I ssh into my server and login as t root user and I’m getting the following error on screen:

Could not chdir to home directory /root: No such file or directory

How do I fix this error under CentOS or Debian Linux server?
[click to continue…]

HowTo Run a Script In Linux

How do I run a Linux shell script? How can I run a script in Linux operating system using command line options?
[click to continue…]

Linux / UNIX: Command For Executing a Shell Script

How do I execute a script under UNIX or Linux like operating system using command prompt?
[click to continue…]

crond: (*system*) BAD FILE MODE Error and Solution

I‘m getting this message in my /var/log/cron

Mar 12 09:20:01 server2 crond[1267]: (*system*) BAD FILE MODE (/etc/cron.d/vnstat)

How do I fix this problem under Fedora / CentO / RHEL or any Linux distro?
[click to continue…]

UNIX / Linux: Explains setuid File Permission

What does it mean for a file to be “setuid?” How do keep track of all setuid enabled file?
[click to continue…]