The scp command in linux is used to securely copy (scp – secure copy) files and folders from one linux server to another. The basic structure of the scp command is as follows:
scp source target
scp username@source_servername_or_ip:/path/to/file_or_directory location/to/copy/file_or_folder/to
When you run the above command from the target directory, you will be prompted to type the password for the username on the source server. The username should have at least read privileges to the file_or_folder you are trying to copy.
To copy to the current directory location, you can just specify a ‘.’ as below:
scp username@source_servername_or_ip:/path/to/file_or_directory .
To copy an entire directory, use the following command:
scp -r username@source_servername_or_ip:/path/to/directory .
Sometimes when you create a dar file from a higher version of composer, and try to install that dar file with an earlier version, the dar deployer shows an error:
This is easily fixed. Open the dar in a program like PKZip, or unzip the dar. There is a version.ini file in the root folder. Comment out the version information:
Just put a # before the above line and save it back to the dar.
Here is a way to truncate a log file on linux:
cp /dev/null file_to_truncate.log
To switch user when you are in the sudoers list:
sudo su - username
Linux will then ask you to type your password (not the user you are switching to, but the user you are logged in as). You can always do whoami to check who you are running the command as
When doing a find command, like the following, if you do not have sufficient permissions, you will get a lot of “permission denied” messages. This sometimes drowns out the few lines where you actually get a hit. One way to avoid that is to add the following to the command:
find / -name filename.txt 2>/dev/null
The 2 in the above command is the error output which is redirected to /dev/null, effectively suppressing your error messages. This way you will only see the successful paths where the file does exist and you have permissions.
Users were getting the following error just after logging in to D2:
The object id of the object appeared in the log file. Since that object was a dm_audit_trail object for a test object, I deleted the object using the following API command:
This resolved the error.
To check entropy:
To increase entropy:
rngd -r /dev/urandom -o /dev/random -b -t 1