Different Ways of File transfer to a remote server using ssh protocol

Different Ways of File transfer to a remote server using ssh protocol.

Scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Using scp from destination server

scp root@source_server:/path/to/file /path/here/
scp -P 2222 root@source_server:/path/to/file /path/here/ #with ssh port 2222
scp -r root@source_server:/path/to/directory/ /path/here/ #copy entire directory

Using scp from source server

Read more

Output alignment problem for ‘df’ command

Sometimes we need to get the output of df command in an arranged manner to use the output in some scripting or not. You can use the following command to view the output in properly formatted form.

df -Ph

   -P, --portability use the POSIX output format
   -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)

You can check the following screenshots for more details.

Read more

cPanel/WHM Successful logins

For getting the successful cPanel/WHM logins, using the following commands. For getting the successful cPanel logins. cat /usr/local/cpanel/logs/session_log | grep “myuser” | grep “NEW .*app=cpaneld” # “myuser” is cPanel username xx.xx.xx.xx [09/11/2015:13:17:40 -0000] NEW myuser:bOMyuserz8hKvThis1XUgnISnh4AWMMXSampleKgHE3lString1JpnOSiK5a45t3 address=122.165.84.98,app=cpaneld,creator=myuser,method=handle_form_login,path=form,possessed=0 For gettign successful WHM logins cat /usr/local/cpanel/logs/session_log | grep “root” | grep “NEW .*app=whostmgrd” # Use required WHM user … Read more

Plesk Roundcube error :Unable to connect to the database

Sometimes you may come across with such an error displayed while going to webmail interface. This can be for both horde or roundcube. DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator To Fix this issue , you need to update the rouncube or horde user password in mysql.user table … Read more

Add extra swap to linux server

If every server had plenty of RAM in the real world that does not happen. If for some reason you have a server with too little SWAP or you are hitting the max of the swap. Here is a quick way to add 1GB swap to the server. dd if=/dev/zero of=/usr/swapfilesys bs=1024 count=1024000 mkswap /usr/swapfilesys … Read more

Prevent .htaccess file modification while running easyapache

Most of the time, the recompilation process of Apache/php with Easyapache with WHM/cPanel server will be effected the users’ .htaccess file. Most probably the entries like “AddHandler” will be commented state. We can prevent the .htaccess file modification from the WHM tweak settings. In WHM-> Server Configuration -> Tweak Settings -> System set Depth to … Read more

Change Site IP in cPanel

Change Site IP via WHM Go to WHM > Change site’s IP Address , select the account, then select the IP Change Site IP via Command Line in cPanel /usr/local/cpanel/bin/setsiteip -u $USER $IP For moving all accounts in a server from one Ip to another using the following script; #! # https://www.nixtree.com # Contact [email protected]Read more

Error : The adminbin “cpmysql” in the “Cpanel” namespace call to function “DBCACHE” ended prematurely: The subprocess reported the “” (255) error when it ended

This error was there in user’s cpanel section and no database, no db users etc were showing in the cpanel for the users. On checking the /varlib/mysql/server.domain.com.err (mysql error log) I can see the mysql user table was corrupted and needed repair 141204 12:13:56 [ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be … Read more