Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, 31 May 2023

Create SFTP user with home directory restriction

 



Restrict on the home directory and sftp only Ubuntu

create a group -
 
sudo addgroup group_name

create a user

useradd -m -d /home/username username

Assign group to user

usermod -g group_name username


restrict the directory and ftp

add below to the end of /etc/ssh/sshd_config file

   Match Group group_name
   ChrootDirectory /home/username
   ForceCommand internal-sftp
   X11Forwarding no
   AllowTcpForwarding no


Still unable to log in to sftp try to change the ownership to root for the user's home directory. 

Also check the mod of the home directory, it should be 755

Saturday, 15 December 2018

Upgrade GLIBC Rhel/CentoOs

To upgrade glibc below package are reuqired.


  • glibc
  • glibc-common
  • glibc-devel
  • glibc-headers
  • glibc-static
  • glibc-utils
Download the above packages from below link, and copy in /tmp directoyr.

Download Package From here 

Make sure all above package should be in same version.


go to the /tmp directory and execute below command to update the packages.

rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
glibc-common-2.17-55.el6.x86_64.rpm \
glibc-devel-2.17-55.el6.x86_64.rpm \
glibc-headers-2.17-55.el6.x86_64.rpm \
glibc-static-2.17-55.el6.x86_64.rpm \
glibc-utils-2.17-55.el6.x86_64.rpm



Check the lattest install version.

rpm -qa |grep glibc

Saturday, 19 May 2018

Mount FTP share locally in Linux using ftpfs

Mount FTP share locally in Linux using ftpfs

 To mount a remote FTP account to locally on Linux system- 

1)Install required Packages
2)Mounting system with remote details
3)Testing

1) - Install fuse-curlftpfs package on you Linux system.

2)- After package installation need to create a mount point(directory) and mount ftp server data using curlftpfs command, to do this you must have ftp details. 

Consider below details.
 
 ftp User: altmish
 ftp Password: tech2smooth
 ftp Host:- ftp.tech2smooth.in
 Mount Directory:-  /usr/ftp_data

Create the mount point and mount ftp account data.
[root@localhost /]#mkdir /usr/ftp_data
[root@localhost /]#curlftpfs -o altmish:tech2smooth@ftp.tech2smooth.in /usr/ftp_data

Note: Above mounted data will be accessible only for the user who mounted the system. To make it public-ally accessible use below.


[root@localhost /]#curlftpfs -o allow_other altmish:tech2smooth@ftp.tech2smooth.in /usr/ftp_data

 3)- Go to ftp data directory

[root@localhost /]#cd /usr/ftp_data

[root@localhost /]#ls -ltrh

Saturday, 5 May 2018

Error parsing HTTP request header- Invalid character found in the request target.



Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
 java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986


Solution

Edit catalina.properties add below line in end of the file.

tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}

 
 

Monday, 30 April 2018

Unable to Start MySQL Linux - Please read "Security" section of the manual....

ISSUE- [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root


Solution- Start mysql using below command.

/usr/sbin/mysqld --user=root --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Friday, 14 November 2014

Want to Copy Single file to Mulitple Location in Linux?


If you are looking for shorter way to copy a file from one location to another location, follow below:

To perform above operation you have to user xargs command in Linux.

Suppose you want to copy a file demo.txtt to three different directory.


echo directory1 directory2 directory3 | xargs -n 1 cp -i demo.txt

The -i option of cp command means that you will be asked whether to overwrite a file in the current directory with the demo.txt.


The -n Use at most max-args arguments per command line.

Enable 'HTML Manager'- Apache Tomcat

 Enable 'HTML Manager'- Apache Tomcat Go to Apache-tomcat's home directory and edit the tomcat-users.xml ${apache_home}/conf/tom...