Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Saturday, December 21, 2013

Rsync + SSH - no password




Install rsync
For Ubuntu or Debian
# apt-get install rsync
For SUSE or Fedora# yum install rsync
rsync without prompting for password:
Assuming the file server is ServerF and backup server is ServerB

Genarate the public key in ServerF
$ ssh-keygen
$ Enter passphrase (empty for no passphrase):
$ Enter same passphrase again:

The public key will be generated and stored in
~/.ssh/id_rsa.pub

Copy public key to remote host
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.1.100
Or
ssh-copy-id -i ~/.ssh/id_rsa.pub "root@192.168.1.100" -p123
Or

Open id_rsa.pub, copy the content
Login to ServerB using the same user in the rsync command
In ServerB, append the contents to ~/.ssh/authorized_keys. Create the file if not exist. Make sure the file mode is 700.

Is it possible to run ssh-copy-id on port other than 22?
Rsync with SSH without prompting for password

Thursday, March 22, 2012

OpenSUSE - VNC - Remmina



You can find this app in Ubuntu repo., however, it's not the case of OpenSUSE.
After googling for some minutes, I found solutions as follow:


linux:/home # zypper ar -f http://download.opensuse.org/repositories/X11:/xfce:/nilda/openSUSE_11.3/X11:xfce:nilda.repo
linux:/home# zypper install remmina

Friday, August 26, 2011

SQUID - The requested URL could not be retrieved

Error from squid is that it can not retrieve the url "/",
but the browser's url is http://google.com

ERROR

The requested URL could not be retrieved


The following error was encountered while trying to retrieve the URL: /
Invalid URL
Some aspect of the requested URL is incorrect.
Some possible problems are:
  • Missing or incorrect access protocol (should be http:// or similar)
  • Missing hostname
  • Illegal double-escape in the URL-Path
  • Illegal character in hostname; underscores are not allowed.
Your cache administrator is .





  
the fix :
in squid.conf :
http_port 3128 transparent



Sunday, August 7, 2011

VirtualBox VBoxManage


In NAT mode, the guest network interface is assigned to the IPv4 range 10.0.x.0/24 by default where x corresponds to the instance of the NAT interface +2. So x is 2 when there is only one NAT instance active. In that case the guest is assigned to the address 10.0.2.15, the gateway is set to 10.0.2.2 and the name server can be found at 10.0.2.3.

If, for any reason, the NAT network needs to be changed, this can be achieved with the following command:

VBoxManage modifyvm "VM name" --natnet1 "192.168.61/24"

This command would reserve the network addresses from 192.168.61.0 to 192.168.61.254 for the first NAT network instance of "VM name". The guest IP would be assigned to 192.168.61.15 and the default gateway could be found at 192.168.61.2.





VBoxManage startvm "New Saratele"

Waiting for the VM to power on...
VM has been successfully started.


Port forwarding with NAT



As the virtual machine is connected to a private network internal to VirtualBox and invisible to the host, network services on the guest are not accessible to the host machine or to other computers on the same network. However, like a physical router, VirtualBox can make selected services available to the world outside the guest through port forwarding. This means that VirtualBox listens to certain ports on the host and resends all packets which arrive there to the guest, on the same or a different port.


Network Interface in Virtual Machine ( Windows Server 2008 - guest ) has IP = 192.168.61.15
Network Interface on the HOST Machine has IP = 192.168.101.22 
ping from guest to host is OK , but from host to guest KO ... 












From Linux : to acces  port 80 ( IIS service ) on the Windows Server 2008  guest : 
1.  VBoxManage modifyvm "New Saratele" --natpf1 "guest_iis,tcp,192.168.101.22,8000,192.168.61.15,80"


2. From host Browser : 
http://192.168.101.22:8000






Network & sharing in VirtualBox - Full tutorial


VBoxManage modifyvm




Thursday, May 19, 2011

FTP and e-mail on the same server

Setting up VSFTP using non-local users.


If an administrator wants for roadwarriors to set up on the same server
email and FTP , it's better that the FTP account has virtual users .

/etc/vsftpd/vsftpd.conf


local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# Virtual users will be logged into /home/virtualftp/[username]/
user_sub_token=$USER
local_root=/home/virtualftp/$USER
guest_enable=YES
guest_username=virtualftp
# Umask applied for virtual users and anon
anon_umask=0022
# Allows uploading by virtual users
anon_upload_enable=YES
# Allows creation of directories by virtual users
anon_mkdir_write_enable=YES
# Allows deletion of files and directories by virtual users
anon_other_write_enable=YES
# Sets a port range for passive mode. (must configure firewall to accept)
pasv_max_port=51123
pasv_min_port=51323
port_enable=YES
Setup virtual FTP usernames and their passwords (use the following format)
/etc/vsftpd/vsftpd_users.txt
username1
passwordforusername1
username2
passwordforusername2
username3
passwordforusername3
Build the vsftpd database
#db42_load -T -t hash -f /etc/vsftpd/vsftpd_users.txt /etc/vsftpd/vsftpd_users.db
#chmod 600 /etc/vsftpd/vsftpd_users.db /etc/vsftpd/vsftpd_users.txt
Create directories for each virtual FTP user
#mkdir -p /home/virtualftp/username1
Test an FTP virtual user login
#ftp localhost
Connected to localhost.
220 (vsFTPd 2.0.5)
Name (localhost:root): username1
331 Please specify the password.
Password:
230 Login successful.

Setting up VSFTPD permissions


I'm setting up a php-driven web app that serves files through a web interface. I've also set up a vsftp server to allow users to upload their data to a virtual directory. The vsftp server uses the pam-mysql module to use the web app's user database so no accounts are created on the system and we can disable ssh access.

Apache and vsftp run as different users , so we needed a way for each of them to view and edit the files created by the other. What we wound up doing was creating a group www-users and make it the group owner of /var/www. Then assigning the users apache and nobody to the group and set the permissons on the /var/www directory to 775. This will allow nobody and any other users in the www-users group to read and write to /var/www; it will also make it easier to authorize other users to write to /var/www — simply assign the user to the www-users group. Here are the steps in case any googlers need a hint.

1) set up vsftpd for umask 0027 (/etc/vsftpd.conf) [local_umask=0027]
2) create www-users group (groupadd www-users)
3) add user to group (usermod -a -G group user)
4) Set apache to run as www-users group (httpd.conf)
5) chgrp www-users /var/www
6) chmod 2775 /var/www
7) Add setgid permission to the directory: chmod g+s /var/www (I believe this is redundant)

Thursday, April 21, 2011

GRUB2 DEFAULT

Ubuntu grub.cfg

Editing /etc/default/grub

You can open /etc/default/grub file with the following command,


gksudo gedit /etc/default/grub
or
gksudo kate /etc/default/grub

This is what it should look like,
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.



GRUB_DEFAULT=0
The number at the end of this line can be changed to make the highlight bar or selection bar in the GRUB Menu appear automatically on any GRUB Menu entry we like.
0 (zero) tells GRUB we want the first or top GRUB entry automatically selected unless we over ride that selection with our up or down arrow key during boot-up.
Any number greater than 0 (zero) will mean boot entries further down the GRUB Menu will be selected instead.

Alternatively, replace the number here with the word 'saved' to enable the grub-set-default command to work.

Monday, April 11, 2011

SPICE Up Your Desktop

Red Hat's Future Linux Desktop

Remember Spice Girls ? 

" When you're feelin' sad and low
We will take you where you gotta go
Smiling dancing everything is free
All you need is positivity 

Colors of the world
Spice up your life
Every boy and every girl
Spice up your life
People of the world
Spice up your life "


We all heard about the Internet CLOUD ;
What about the DESKTOP Cloud ?
SPICE Up Your DESKTOP !

SPICE Client - Windows 7
http://www.redhat.com/v/swf/rhev/spice.html

With SPICE will be a lot easier to switch to Desktop Linux. 
I.T. Departments who must forget about old (FoxPro!) desktop applications  , can switch to SPICE .
The user will not comment because his computer will continue to run Windows.
In the second step - when all enterprise apps runs on the - Virtual "CLOUD" Desktop  - the user's computer will BOOT the Fedora (or Ubuntu?) Desktop and the user cannot complain because he is already familiar with the new business software.

One might say that users can and will complain!  Its what they do best. They will complain about anything that is different than what they did yesterday.

IF - the management approves and enforces the new ERP via SPICE , in a Small Business, a complaining user has only one alternative : to resign
In this way, Internet Explorer and Microsoft Office can disapper in a few years ...

Another subtile way of introducing SPICE is with a WEBMAIL server. If an user wants Mozilla Seamonkey or Thunderbird, they cannot have it on their desktop, but instead on the SPICE client ...

In the long term , Linux can BOOT many desktop clients on the business networks.
I think it's a very good plan and I wish that Red Hat will double the income and the market capitalization.

What will be nice to have on a Desktop-Style Cloud-Client ?
If I log off from the SPICE Server and leave a lot of Apps open, and shutdown the windows-client computer at Work , when at home-linux computer , logging at work on the SPICE Server, to be able to access the desktop with the opened Apps and continue work from home ...

   ... something similar with the principle of SCREEN text-mode linux command , but in graphics-mode

Why not an Android device as the Desktop-Based--Cloud-Terminal
to the Spice-Service on a RHEL Server ?
 

SPICE guest drivers released for Windows

HP Delivers Proliant-Based Desktop Virtualization

 

Wednesday, April 6, 2011

THE ONE PAGE FEDORA SERVER MANUAL

Config files , tips and tricks
 - WORK in PROGRESS -

tail -f /var/log/messages : Display the last 10 lines of the system log.
/etc/rc.d/rc.local            : Bash script that is executed at the end of login process.
                                         Similar to autoexec.bat in DOS.
/etc/hosts                      : A list of all know host names and IP addresses on the machine.
/etc/resolv.conf             : Defines IP addresses of DNS servers.

Config files for sendmail | squirrelmail | webmail :
/etc/procmailrc        
/etc/mail/local-host-names

hostname : /etc/hostname

on older systems :
 /etc/sysconfig/network

Friday, March 11, 2011

Linux as a Rolling Stone

@: Novell openSUSE 11.4 :
   - could be the last distro you ever actually install thanks to Tumbleweed

Newest openSUSE Linux Offers Rolling Releases
  
The newest release of Novell's openSUSE Linux debuts with LibreOffice, KDE 4.6, a zippy package management system and a new rolling release system that could eliminate the need for future big releases.


The rolling release capability in openSUSE 11.4 is called Project Tumbleweed and for those that embrace it, it could mean the end to big milestone updates for openSUSE. 


"The Tumbleweed repository will have a slightly higher chance of breakage than simply running a stable version," Poortvliet said. "I wouldn't recommend it to every openSUSE user, but it is easier than running Gentoo or Arch." 

The openSUSE Build Service (OBS) is the key technology that sit behind enabling Tumbleweed for openSUSE 11.4. OBS is Novell's system for building Linux packages and is also the platform on which the openSUSE distribution is built. 










































Not Everybody is a Fan of Ubuntu

One of the other advantages of Linux Mint Debian Edition over the Ubuntu versions is that the Debian version is a rolling release. This simply means that it is updated continuously; you never have to do another install to upgrade it as you do with the Ubuntu versions. Here’s a more detailed explanation from Wikipedia:
In software development, a rolling release approach refers to a continuously developing software system, as opposed to one with versions that must be reinstalled over the previous versions. It is one of many types of software release life cycles. Rolling releases are typically seen in use by Linux distributions.
A rolling release is typically implemented using small and frequent updates. However, simply having updates does not automatically mean that a piece of software is using a rolling release cycle; to qualify as a rolling release, the philosophy of developers must be to work with one code branch, as opposed to discrete versions. Updates are typically delivered to users using a package manager and a software repository accessed through the internet.

Thursday, March 3, 2011

Splashtop: Linux next to Windows

http://www.zdnet.com/blog/open-source/splashtop-linux-for-windows-users/8379

If you’re tired of waiting for Google’s Chrome operating system and want something that’s like it but you can probably run on your existing hardware, Splashtop is for you. Also, if you’re a Windows user that just needs a quick way to get on the Web, give it a try. I think you’ll like it, even if you’ve never had any interest in Linux.