≡ Menu

ssh

How do I execute a script on remote server called server2.example.com from my PC? How to run a shell/python/perl script on remote Unix-like systems?
[click to continue…]

What is the difference between authentication and authorization? Why it is important to understand difference between the two? Authentication vs. Authorization -- what are they and how do they differ?
[click to continue…]

I'm trying to login using ssh keys but server is only allows to login me using a password. The following message is logged into server /var/log/secure file:

Feb 25 06:36:50 ns5 sshd[26681]: Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys2

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

Q. I've couple of Linux / Windows server hosted in remote data center? My ISP provides following option for rebooting the box:
a) Graceful shutdown command
b) An IPMI reboot
c) A power strip

Which one is the best way to reboot server and why?
[click to continue…]

Install OpenSSH Server on Asus EEE PC

Q. How do I install OpenSSH server on Asus EEE Laptop PC?
[click to continue…]

How to Tunnel X Windows Securely over SSH

Q. How do I tunnel X Windows Securely over SSH? I'd like to run X program on my remote Linux server and get back display to Laptop computer connected by high speed internet?

A. A tunneling protocol is a network protocol which encapsulates a payload protocol, acting as a payload protocol. Reasons to tunnel include carrying a payload over an incompatible delivery network, or to provide a secure path through an untrusted network.

SSH is frequently used to tunnel insecure traffic over the Internet in a secure way. Simply type the following command:

$ ssh -X user@server.corp.com
$ ssh -X user@202.54.1.2

You can requests compression of all data to improve up user experience (good for a low speed link such as wan link) using -c option:
$ ssh -c -X user@202.54.1.2

Once logged in type any X windows program name such as:
$ xeys &
$ oowriter &

To start kde type:
$ startkde &

To start default desktop type:
$ startx

Q. I've CentOS Linux cpanel server. I'd like to turn off SFTP server but only allow SSH for root user. How do I trun off sftp server?

A. OpenSSH / sshd reads configuration data from /etc/ssh/sshd_config. The file contains keyword-argument pairs, one per line. Lines starting with ‘#’ and empty lines are interpreted as comments. Configures an external subsystem such file transfer daemon (SFTP) done through this file only. Arguments should be a subsystem name and a command to execute upon subsystem request. The command sftp-server implements the “sftp” file transfer subsystem. sftp-server is a program that speaks the server side of SFTP protocol. sftp-server is not intended to be called
directly, but from sshd using the Subsystem option.

Disable / Turn off sftp server

Open /etc/ssh/sshd_config file:
# vi /etc/ssh/sshd_config
Find line that read as follows:
Subsystem sftp /usr/lib/openssh/sftp-server
Remove or comment out line by prefixing #:
# Subsystem sftp /usr/lib/openssh/sftp-server
Save and close the file. Restart sshd service:
# /etc/init.d/sshd restart