Monday, February 2, 2015

The /etc/hosts and /etc/resolv.conf file for Bind server on CentOS 7

/etc/hosts file should contain

127.0.0.1 localhost server1
192.168.28.150 server1.sourav.com server1


/etc/resolv.conf should contain

search sourav.com
nameserver 127.0.0.1



My Network Configuration file looks like this

TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="no"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens33"
UUID="9a7aed2a-76a6-48c7-a320-f581c760e8d4"
ONBOOT="yes"
IPADDR0="192.168.28.150"
PREFIX0="24"
GATEWAY0="192.168.28.2"
DNS1="127.0.0.1"
HWADDR="00:0C:29:5D:DD:7D"

Vsftpd with SSL-TLS on CentOS 7

after installing vsftpd you have to perform
setsebool -P ftp_home_dir=1

sudo mkdir /etc/ssl/private

To create the certificate and the key in a single file, we can use this command:

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

go to /etc/vsftpd/vsftpd.conf
comment the line
anonymous_enable=YES

uncomment the line
chroot_local_user=YES
add the line

dual_log_enable=YES
At the end add those lines
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES

ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH

save the file
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-port=21/udp

firewall-cmd --permanent --add-port=20/tcp
firewall-cmd --permanent --add-port=20/udp

firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
service vsftpd restart
chkconfig vsftpd on

Tuesday, January 20, 2015

Set IP to Windows 7 from command line

 netsh interface ip set address "connection name" static 192.168.0.101 255.255.255.0 192.168.0.1


NOTE: The default connection names are Local Area Connection for wired adapters and Wireless Network Connection for Wi-Fi adapters. The IP address order: client IP, subnet mask, and gateway IP.


Here’s how to configure the DNS addresses:


netsh interface ip add dns "connection name" 208.67.222.222


netsh interface ip add dns "connection name" 208.67.220.220 index=2


NOTE: Remember to replace the connection names and IP addresses.


 To dump the TCP/IP configuration:

    netsh -c interface dump > PATH_AND_FILENAME.txt


To import the TCP/IP configuration:

    netsh -f PATH_AND_FILENAME.txt
For setting dhcp



netsh interface ip set address "Local Area Connection" dhcp




Tuesday, January 13, 2015

Delete IOS from Flash, boot from new IOS ,TFTP


sh flash

delete flash

confirm y


reload


rommon 1> IP_ADDRESS=x.x.x.x
rommon 2> IP_SUBNET_MASK=x.x.x.x
rommon 3> DEFAULT_GATEWAY=x.x.x.x
rommon 4> TFTP_SERVER=x.x.x.x
rommon 5> TFTP_FILE=1841-i-mz.bin

type 
tftpdnld

and press enter

if everything right the ios will be copied to flash

then 

reset

and you are done

Pen Drive mounted as read only error

Recently I have come across this error in Ubuntu

using mount command find the mounted location

and then

mount -o remount,rw /mount/point