Friday, February 22, 2013

Install package without dependencies

Install package without dependencies

[root@my32GB Packages]# rpm -ivh --nodeps --force

Sunday, February 10, 2013

Transferring files (ftp, scp) to the Remote server

Transferring files between different systems.

If you have a requirement to migrate your system or data, you possibly have to manually copy the content to a different system. Here are the basic steps that you can use to set up your environment.

1. Set up passwordless authentication with ssh-keygen
2. Copy key to destination server.
3. Test your login without suppyling passwird before you use ftp or scp.
4. use the following script to transfer your files.

# FTP script
# V.01
sftp dee@sama << EOF
cd /home/dee/myfiles/
put files*

exit 0

Note: Note the EOF to EOF, you can use anything to name but what you put to start at the beging, you have to end with same name to end.


once you have key set up, you can use combination rsync and ssh to make a secure connection to transfer files and directories. or you can simply use tar and ssh to send files to the destination server.

Saturday, February 9, 2013

Creating user manually using vi

Creating user manually using vi

To  add user manually using vi
a. user vipw command and go to end of the page and yang the current user info and paste. Change the user name, id, home directory and other relevant info.
b. use passwd command to change the just created user password.
c. vigr to add group entry, yank existing users group and paste. make changes according to the user group.
d. vigr -s to add entry to gshadow.
e. Create user's home directory and copy login initialization files from /etc/skel directory.

Note: When you use cp command to copy the files, it does not include hidden files. To turn on this feature, run the following command.

[root@my32GB ~]# shopt -s dotglob
[root@my32GB ~]# cp /etc/skel/* /home/ramila/

Once done, turn it off (unset) using the following command,

[root@my32GB ~]# shopt -s dotglob

======= detail =======

[root@my32GB ~]# vipw
[root@my32GB ~]# cp -a /etc/skel/.??* /home/ramila/
[root@my32GB ~]# vipw -s

or to set user password,
[root@my32GB ~]# passwd ramile

[root@my32GB ~]# vigr

[root@my32GB ~]# id ramila
[root@my32GB ~]# vigr -s

[root@my32GB ~]# mkdir /home/ramila

[root@my32GB ~]# cp -a /etc/skel/.??* /home/ramila/