≡ Menu

ssh command

Linux Iptables: Add / Delete An IP Address Remotely Using A Shell Script

I've root ssh access and need to add / delete a few IP address on fly using the IPtables command via local shell script. How do I add or delete an IP address remotely over the SSH session under CentOS / Redhat / RHEL / Debian / Ubuntu Linux?
[click to continue…]

HowTo: Execute A Script On Remote UNIX / Linux Server

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…]

sudo: Sorry, you must have a tty to run sudo Error on a Linux and Unix

I'm trying to run the following command:

ssh user@box.example.com sudo command1 /path/to/file

But, an error is displayed follows:

sudo: sorry, you must have a tty to run sudo


sudo: no tty present and no askpass program specified

How do I fix this problem on Linux or Unix based systems?
[click to continue…]

Import MySQL Dumpfile, SQL Datafile Into My Database

How can I import a MySQL dumpfile into my database? I'm using CentOS Linux 5 server. My old hosting provider gave me a data.sql file and I do have access to my Unix / Linux server via ssh. So How do I restore my data using command line over the ssh session?
[click to continue…]