Tuesday, June 15, 2010

USERADD WITH HOME DIRECTORY

useradd -d /home/username -s /bin/bash username

passwd username


chown mindtree:mindtree mindtree


vi /etc/sudoers


mindtree ALL=ALL ALL

SFTP Server Configuration with Jail kit

jk_addjailuser -c “chaitanya|testuser|chaitanya_yalamanchili@mindtree.com|suma|test_sftp|06-06-2010|20-06-2010|” -g chaitanya

jk_addjailuser -c "M1011646|testuser|test_user@mindtree.com||24-May-2010|31-May-2011" -g testuser testuser


jk_addjailuser -c “|chaitanya|chaitanya_yalamanchili@mindtree.com|suma|test_sftp|06-06-2010|20-06-2010|” -g chaitany



./configure
make
make install

cp extra/jailkit /etc/init.d/jailkit
chmod a+x /etc/init.d/jailkit


mkdir /sftp

jk_init -j /sftp jk_lsh
jk_init -j /sftp sftp
jk_init -j /sftp scp

# create the account
adduser testftp

jk_jailuser -j /sftp testftp

# edit the jk_lsh configfile in the jail (man jk_lsh)

vim /sftp/etc/jailkit/jk_lsh.ini

[testuser]
paths= /usr/lib/
executables= /usr/libexec/openssh/sftp-server
allow_word_expansion =0
umask = 077


# now restart jk_socketd
/etc/init.d/jailkit restart
# test the account
sftp test@localhost
# check the logs if everything is correct
tail /var/log/daemon.log /var/log/auth.log

SAMBA SERVER CON

Install samba rpm on the server

then restart samba server

edit the sbm.conf file

vi /etc/samba/smb.conf


[Partha_de]

path = /users/Bluewiz/m1010266

valid users = m1010266

public = no

writable = yes

browseable = yes


add the above lines and save and close the samba file



then

add samba user to

smbpasswd -a srinivas


.